0%

Problem 467


Problem 467


Superinteger

An integer s is called a superinteger of another integer n if the digits of n form a subsequence of the digits of s.
For example, 2718281828 is a superinteger of 18828, while 314159 is not a superinteger of 151.

Let p(n) be the nth prime number, and let c(n) be the nth composite number. For example, p(1) = 2, p(10) = 29, c(1) = 4 and c(10) = 18.
{p(i) : i ≥ 1} = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, …}
{c(i) : i ≥ 1} = {4, 6, 8, 9, 10, 12, 14, 15, 16, 18, …}

Let PD the sequence of the digital roots of {p(i)} (CD is defined similarly for {c(i)}):
PD = {2, 3, 5, 7, 2, 4, 8, 1, 5, 2, …}
CD = {4, 6, 8, 9, 1, 3, 5, 6, 7, 9, …}

Let Pn be the integer formed by concatenating the first n elements of PD (Cn is defined similarly for CD).
P10 = 2357248152
C10 = 4689135679

Let f(n) be the smallest positive integer that is a common superinteger of Pn and Cn.
For example, f(10) = 2357246891352679, and f(100) mod 1 000 000 007 = 771661825.

Find f(10 000) mod 1 000 000 007.


超级整数

整数s被称为是另一个整数n的超级整数,当且仅当n的数字串是s的数字串的子串
例如2718281828是18828的超级整数,而314159不是151的超级整数。

记p(n)是第n个质数,而c(n) 是第n个合数。例如p(1) = 2,p(10) = 29,c(1) = 4,而c(10) = 18。
{p(i) : i ≥ 1} = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, …}
{c(i) : i ≥ 1} = {4, 6, 8, 9, 10, 12, 14, 15, 16, 18, …}

记PD 是{p(i)}中各项的数字根组成的序列(CD同理):
{p(i) : i ≥ 1} = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, …}
{c(i) : i ≥ 1} = {4, 6, 8, 9, 10, 12, 14, 15, 16, 18, …}

记Pn是将PD的前n项连接起来所得的整数(Cn同理)。
PD = {2, 3, 5, 7, 2, 4, 8, 1, 5, 2, …}
CD = {4, 6, 8, 9, 1, 3, 5, 6, 7, 9, …}

记f(n)是Pn和Cn的最小公共超级整数。
例如,f(10) = 2357246891352679,而f(100) mod 1 000 000 007 = 771661825。

求f(10 000) mod 1 000 000 007。