Problem 506
Clock sequence
Consider the infinite repeating sequence of digits:
Amazingly, you can break this sequence of digits into a sequence of integers such that the sum of the digits in the n’th value is n.
The sequence goes as follows:
Let vn be the n’th value in this sequence. For example, v2 = 2, v5 = 32 and v11 = 32123.
Let S(n) be v1 + v2 + … + vn. For example, S(11) = 36120, and S(1000) mod 123454321 = 18232686.
Find S(1014) mod 123454321.
钟摆序列
考虑下面这个无限重复的数字序列:
神奇的是,你可以将这个序列分解成一个整数的序列,使得第n个整数的各位数字之和恰好是n。
这个整数序列如下所示:
记vn是这个整数序列的第n个整数,例如,v2 = 2,v5 = 32,以及v11 = 32123。
记S(n)为v1 + v2 + … + vn。例如,S(11) = 36120,以及S(1000) mod 123454321 = 18232686。
求S(1014) mod 123454321。