OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..15358 (all terms with <= 13 digits)
Patrick De Geest, World!Of Numbers
EXAMPLE
6666 = 2112 + 2222 + 2332.
PROG
(Python)
from itertools import product
def ispal(n): s = str(n); return s == s[::-1]
def pals(d, base=10): # all d-digit palindromes
digits = "".join(str(i) for i in range(base))
for p in product(digits, repeat=d//2):
if d > 1 and p[0] == "0": continue
left = "".join(p); right = left[::-1]
for mid in [[""], digits][d%2]: yield int(left + mid + right)
def auptod(dd):
alst = [6, 9]
last3 = [7, 8, 9]
for d in range(2, dd+1):
for p in pals(d):
last3 = last3[1:] + [p]
if ispal(sum(last3)): alst.append(sum(last3))
return alst
print(auptod(5)) # Michael S. Branicky, Jun 09 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Sep 15 1998
STATUS
approved