login
A389006
a(n) = A389005(n) + A389005(n+1) + A389005(n+2).
2
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 28, 30, 41, 33, 31, 42, 43, 34, 45, 44, 46, 35, 36, 37, 48, 47, 49, 38, 39, 40, 51, 50, 52, 63, 64, 56, 67, 66, 68, 57, 58, 59, 70, 69, 71, 60, 61, 62, 73
OFFSET
0,3
COMMENTS
All terms are distinct.
LINKS
Rémy Sigrist, PARI program
EXAMPLE
a(42) = A389005(42) + A389005(43) + A389005(44) = 33 + 1 + 3 = 37.
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
Sequence in context: A352800 A154470 A194907 * A090106 A369464 A167662
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 22 2025
STATUS
approved