login
Smallest number whose digit sum is n^4.
1

%I #12 Jul 03 2018 02:26:00

%S 1,79,999999999,49999999999999999999999999999,

%T 4999999999999999999999999999999999999999999999999999999999999999999999,

%U 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

%N Smallest number whose digit sum is n^4.

%H Harry J. Smith, <a href="/A060711/b060711.txt">Table of n, a(n) for n = 1..9</a>

%F a(n) >= 10^(n^4/9) - 1.

%t Do[ a = {}; While[ Apply[ Plus, a ] + 9 < n^4, a = Append[ a, 9 ] ]; If[ Apply[ Plus, a ] != n^4, a = Prepend[ a, n^4 - Apply[ Plus, a ] ] ]; Print[ FromDigits[ a ] ], {n, 1, 6} ]

%o (PARI) { for (n=1, 9, s=n^4; x=s\9; d=s - 9*x; write("b060711.txt", n, " ", (d+1)*10^x - 1); ) } \\ _Harry J. Smith_, Jul 10 2009

%Y Cf. A061104, A061105.

%K nonn,base

%O 1,2

%A _Robert G. Wilson v_, Apr 21 2001