0%

Problem 637


Problem 637


Flexible digit sum

Given any positive integer n, we can construct a new integer by inserting plus signs between some of the digits of the base B representation of n, and then carrying out the additions.

For example, from n=12310 (n in base 10) we can construct the four base 10 integers 12310, 1+23=2410, 12+3=1510 and 1+2+3=610.

Let f(n,B) be the smallest number of steps needed to arrive at a single-digit number in base B. For example, f(7,10)=0 and f(123,10)=1.

Let g(n,B1,B2) be the sum of the positive integers i not exceeding n such that f(i,B1)=f(i,B2).

You are given g(100,10,3)=3302.

Find g(107,10,3).


灵活的数字和

给定任意正整数n,我们可以通过在nB进制表示中插入加号,并计算加法的结果,来构造新的整数。

例如,从n=12310 (10进制表示的n)出发,我们能够构造四个10进制整数:123101+23=241012+3=15101+2+3=610

f(n,B)为将B进制下的n变为一位数所需的最少步数。例如,f(7,10)=0f(123,10)=1

g(n,B1,B2)为所有小于等于n且满足f(i,B1)=f(i,B2)的正整数i之和。

已知g(100,10,3)=3302

g(107,10,3)


0 comments
Anonymous
Markdown is supported

Be the first person to leave a comment!