A060713 Smallest number whose sum of digits is 5^n.
1, 5, 799, 89999999999999, 4999999999999999999999999999999999999999999999999999999999999999999999
Offset: 0
Links
- Harry J. Smith, Table of n, a(n) for n = 0..5
Programs
-
Mathematica
Do[ a = {}; While[ Apply[ Plus, a ] + 9 < 5^n, a = Append[ a, 9 ] ]; If[ Apply[ Plus, a ] != 5^n, a = Prepend[ a, 5^n - Apply[ Plus, a ] ] ]; Print[ FromDigits[ a ] ], {n, 1, 4} ]
-
PARI
a(n)={ my(s=5^n, x=s\9, d=s-9*x); (d+1)*10^x - 1 } \\ Harry J. Smith, Jul 10 2009
Formula
a(n) = A051885(5^n).