%I #29 Jun 26 2024 10:49:54
%S 1,9,13,19,25,37,43,52,55,70,76,79,85,99,103,108,118,127,135,142,144,
%T 153,171,166,178,181,189,198,205,211,220,232,234,243,252,261,265,274,
%U 279,283,297,298,313,316,325,334,337,346,358
%N a(n) is the largest digit sum of all n-digit fourth powers.
%e a(3) = 13 because 13 is the largest digital sum encountered among all 3-digit fourth powers (attained at both fourth powers: 256, 625).
%t Table[Max@Map[Total@IntegerDigits[#^4] &, Range[Ceiling[10^((n - 1)/4)], Floor[(10^n-1)^(1/4)]]], {n, 32}]
%o (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
%o (Python)
%o from sympy import integer_nthroot
%o 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
%Y Cf. A055565, A018072, A018074.
%Y Cf. A348300, A373727.
%K nonn,base,more
%O 1,2
%A _Zhining Yang_, Jun 22 2024
|