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(104)=3737.

Find C(1013).

954. 数字七恐惧症

如果一个正整数不能被 7 整除,且在交换这个数的任意两个数码后,仍然无法得到能被 7 整除的数,则称这个数是 害怕七的。注意:不允许在交换数码之前、之后出现前导零。

例如,171305 都是害怕七的数,但是 14132 不是,因为 14231 可被 7 整除。

C(N)N 的害怕七的正整数的数量。已知:C(100)=74C(104)=3737

C(1013)


这个链接 回到源站。

这个链接 回到详细版题目目录。