A374025 a(n) is the largest digit sum of all n-digit fifth powers.
1, 5, 9, 27, 27, 36, 45, 46, 52, 63, 72, 80, 89, 90, 99, 104, 108, 119, 126, 143, 137, 152, 157, 162, 175, 180, 182, 189, 198, 208, 209, 216, 225, 234, 236, 250, 253, 270, 270, 284, 286, 288, 297, 310, 315, 323, 324, 334, 341, 346, 351, 364
Offset: 1
Examples
a(5) = 27 because 27 is the largest digital sum encountered among all 5-digit fifth powers (16807, 32768, 59049).
Programs
-
Mathematica
Table[Max@Map[Total@IntegerDigits[#^5] &, Range[Ceiling[10^((n - 1)/5)], Floor[(10^n-1)^(1/5)]]], {n, 40}]
-
Python
from sympy import integer_nthroot def A374025(n): return max(sum(int(d) for d in str(m**5)) for m in range((lambda x:x[0]+(x[1]^1))(integer_nthroot(10**(n-1),5)),1+integer_nthroot(10**n-1,5)[0])) # Chai Wah Wu, Jun 26 2024
Extensions
a(41)-a(49) from Chai Wah Wu, Jun 26 2024
a(50)-a(52) from Chai Wah Wu, Jun 27 2024
Comments