OFFSET
1,2
EXAMPLE
a(3) = 13 because 13 is the largest digital sum encountered among all 3-digit fourth powers (attained at both fourth powers: 256, 625).
MATHEMATICA
Table[Max@Map[Total@IntegerDigits[#^4] &, Range[Ceiling[10^((n - 1)/4)], Floor[(10^n-1)^(1/4)]]], {n, 32}]
PROG
(PARI) a(n) = my(m=ceil(10^((n-1)/4)), M=sqrtint(sqrtint(10^n))); vecmax(apply(sumdigits, vector(M-m+1, i, (i+m-1)^4))); \\ Michel Marcus, Jun 23 2024
(Python)
from sympy import integer_nthroot
def A373914(n): return max(sum(int(d) for d in str(m**4)) for m in range((lambda x:x[0]+(x[1]^1))(integer_nthroot(10**(n-1), 4)), 1+integer_nthroot(10**n-1, 4)[0])) # Chai Wah Wu, Jun 26 2024
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Zhining Yang, Jun 22 2024
STATUS
approved