OFFSET
0,3
COMMENTS
All terms are distinct.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..9998
Rémy Sigrist, PARI program
PROG
(PARI) \\ See Links section.
(Python)
from itertools import count, islice, product
def pals(): # generator of palindromes
digits = "".join(str(i) for i in range(10))
for d in count(1):
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 agen(): # generator of terms
a3, sumset = [0, 0, 0], {0}; yield 0
while True:
m = sum(a3[1:])
an, s = next((p, m+p) for p in pals() if m+p not in sumset)
yield s; a3 = a3[1:] + [an]; sumset |= {s}
print(list(islice(agen(), 68))) # Michael S. Branicky, Sep 26 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 22 2025
STATUS
approved
