0%

Problem 706


Problem 706


3-Like Numbers

For a positive integer n, define f(n) to be the number of non-empty substrings of n that are divisible by 3. For example, the string “2573” has 10 non-empty substrings, three of which represent numbers that are divisible by 3, namely 57, 573 and 3. So f(2573)=3.

If f(n) is divisible by 3 then we say that n is 3-like.

Define F(d) to be how many d digit numbers are 3-like. For example, F(2)=30 and F(6)=290898.

Find F(105). Give your answer modulo 1 000 000 007.


3似数

将正整数n视为数字串,记f(n)为能被3整除的n的非空子串数目。例如,数字串”2573”有10个非空子串,其中有三个能被3整除,分别是575733,因此f(2573)=3

如果f(n)能被3整除,则称n3似数

F(d)d位数中3似数的个数。例如,F(2)=30F(6)=290898

F(105)并将你的答案对1 000 000 007取余。


Gitalking ...