0%

Problem 413


Problem 413


One-child Numbers

We say that a d-digit positive number (no leading zeros) is a one-child number if exactly one of its sub-strings is divisible by d.

For example, 5671 is a 4-digit one-child number. Among all its sub-strings 5, 6, 7, 1, 56, 67, 71, 567, 671 and 5671, only 56 is divisible by 4.
Similarly, 104 is a 3-digit one-child number because only 0 is divisible by 3.
1132451 is a 7-digit one-child number because only 245 is divisible by 7.

Let F(N) be the number of the one-child numbers less than N.
We can verify that F(10) = 9, F(103) = 389 and F(107) = 277674.

Find F(1019).


独子数

我们称一个d位正整数(没有前导零)为独子数,如果它恰好只有一个子串能够被d整除。

例如,5671是一个四位独子数。它的所有子串5, 6, 7, 1, 56, 67, 71, 567, 671和5671中,只有56能够被4整除。
同样的,104是一个三位独子数,因为只有0能够被3整除。
1132451是一个七位独子数,因为只有245能够被7整除。

记F(N)是小于N的独子数的数目。
可以验证F(10) = 9, F(103) = 389以及F(107) = 277674。

求F(1019)。