Problem 954
Heptaphobia
A positive integer is called heptaphobic if it is not divisible by seven and no number divisible by seven can be produced by swapping two of its digits. Note that leading zeros are not allowed before or after the swap.
For example, $17$ and $1305$ are heptaphobic, but $14$ and $132$ are not because $14$ and $231$ are divisible by seven.
Let $C(N)$ count heptaphobic numbers smaller than $N$. You are given $C(100) = 74$ and $C(10^4) = 3737$.
Find $C(10^{13})$.
恐七数
如果一个正整数本身不能被$7$整除,且交换它的任意两个数字后也无法被$7$整除,则称其为恐七数。注意在交换前后都不允许有前导零。
例如,$17$和$1305$是恐七数,而$14$和$132$则不是,因为$14$和$231$能被$7$整除。
记$C(N)$为小于$N$的恐七数的数目。已知$C(100) = 74$,$C(10^4) = 3737$。
求$C(10^{13})$。