A061105 Smallest number whose sum of digits is n^3.
0, 1, 8, 999, 19999999, 89999999999999, 999999999999999999999999, 199999999999999999999999999999999999999, 899999999999999999999999999999999999999999999999999999999
Offset: 0
Examples
a(4) = 19999999, 1+9+9+9+9+9+9+9 = 64 = 4^3.
Links
- Harry J. Smith, Table of n, a(n) for n=0,...,20
Programs
-
Mathematica
Do[a = {}; While[Apply[Plus, a] + 9 < n^3, a = Append[a, 9]]; If[ Apply[ Plus, a] != n^3, a = Prepend[ a, n^3 - Apply[ Plus, a]] ]; Print[ FromDigits[ a]], {n, 1, 10} ] dsn3[n_]:=Module[{t=(n^3-{0,1,8})/9},Which[ IntegerQ[t[[1]]],FromDigits[ PadRight[ {},t[[1]],9]],IntegerQ[t[[2]]],FromDigits[ PadRight[ {1}, t[[2]]+1,9]],IntegerQ[t[[3]]],FromDigits[PadRight[{8},t[[3]]+1,9]]]]; Array[dsn3,10,0] (* Harvey P. Dale, Jul 19 2018 *)
-
PARI
a(n) = { ((n%3)^3 + 1)*10^(n^3\9) - 1 } \\ Harry J. Smith, Jul 19 2009
Formula
a(n) = A051885(n^3).
a(n) =((n mod 3)^3+1)*10^floor[n^3/9]-1 =(A021559(n+1)+1)*10^A061263(n)-1. - Henry Bottomley, Apr 24 2001
Extensions
More terms from Robert G. Wilson v, Apr 21 2001
Comments