← RoseCode

ROSECODE 340

Sum of digits equation

Philippe_57721 · Programming ·

We define DS(n)=n+SOD(n) where SOD(n) is the sum of the digits of n (See problem 260)

It can be proved that 1013+1 is the smallest integer such as the equation DS(x)=n has 3 solutions.
1013+1={DS(9999999999892)DS(9999999999901)DS(10000000000000) It can be proved too that n=102222222222224+10000000000002 is the smallest integer with 6 solutions.

Obviously, if x is a solution we must have x<n. Thus, we can write a solution as nxi

Find these solutions.

Answer format: x1,x2,x3,x4,x5,x6 // xi in ascending order

Example : 1,100,109 // For 1013+1

[My timing: < 1 sec]

Thanks to sinan who helped me to improve this problem.