0%

Problem 924


Problem 924


Larger Digit Permutation II

Let B(n) be the smallest number larger than n that can be formed by rearranging digits of n, or 0 if no such number exists. For example, B(245)=254 and B(542)=0.

Define a0=0 and an=an12+2 for n>0.
Let U(N)=n=1NB(an). You are given U(10)543870437(mod109+7).

Find U(1016). Give your answer modulo 109+7.


更大的数字重排(二)

B(n)为通过重排n的数字所能形成的比n大的最小数,如果不存在这样的数则为0。例如,B(245)=254B(542)=0

定义a0=0,且对于n>0an=an12+2
U(N)=n=1NB(an)。已知U(10)543870437(mod109+7)

U(1016),并对109+7取余作为你的答案。


0 comments
Anonymous
Markdown is supported

Be the first person to leave a comment!