OFFSET
1,3
EXAMPLE
353 = 2^4 + 3^4 + 4^4
979 = 1^4 + 2^4 + 3^4 + 4^4 + 5^4
16561 = 9^4 + 10^4
998899 = 19^4 +...+ 23^4
2138312 = 10^4 +...+ 25^4
85045192129154058 = 5582^4 +...+ 5666^4
PROG
(Python)
import heapq
def ispal(n): s = str(n); return s == s[::-1]
def afind():
print("0, ") # special case
N, T = 4, 1 # power, min number of terms
sigma = sum(i**N for i in range(1, T+1))
h = [(sigma, 1, T)]
nextcount = T + 1
while True:
(v, s, l) = heapq.heappop(h)
if ispal(v): print(f"{v}, [= Sum_{{i = {s}..{l}}} i^{N}]")
if v >= sigma:
sigma += nextcount**N
heapq.heappush(h, (sigma, 1, nextcount))
nextcount += 1
v -= s**N; s += 1; l += 1; v += l**N
heapq.heappush(h, (v, s, l))
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Chai Wah Wu, Jan 29 2016
EXTENSIONS
a(13)-a(15) from Giovanni Resta, Aug 27 2019
STATUS
approved