A380797 a(n) is the largest number whose fourth power is an n-digit which has the maximum sum of digits (A373914(n)).
1, 3, 5, 8, 16, 26, 56, 88, 118, 308, 518, 974, 1768, 2868, 5396, 8979, 17306, 28871, 55368, 97063, 167622, 289146, 562341, 835718, 1727156, 3154276, 5623116, 9397404, 17728256, 27831542, 53129506, 98665756, 166025442, 315265896, 510466356, 904245732, 1188893858, 2298249374, 5315776056
Offset: 1
Examples
a(7) = 56 because among all 7-digit fourth powers, 56^4=9834496 is the largest one (another smaller is 47^4=487968) which has the maximum sum of digits, 43 = A373914(7).
Programs
-
C
/* See A373914. */
-
Mathematica
a[n_]:=Module[{m=Floor[(10^n-1)^(1/4)], max=0}, For[k=m, k>=Ceiling[10^((n-1)/4)], k--, t=Total@IntegerDigits[k^4]; If[t>max, s=k; max=t]]; s]; Table[a[n], {n, 30}]