login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A332661
a(1)=1; a(n+1) is the smallest palindrome not already in the sequence such that the product of a(n+1) and a(n) is also a palindrome.
1
1, 2, 3, 11, 4, 22, 101, 5, 111, 6, 1001, 7, 88, 77, 8, 1111, 9, 10001, 33, 121, 131, 202, 44, 2002, 141, 212, 1221, 303, 2112, 222, 3003, 232, 10101, 55, 99, 555, 979, 5555, 9779, 55555, 97779, 100001, 66, 1000001, 151, 11011, 161, 11111, 171, 101101, 181
OFFSET
1,2
COMMENTS
First mentioned by Eric Angelini in the 'math-fun' mailing list on Jan 12, 2020.
The sequence is infinite because, when all smaller numbers fail, a sufficiently large 10^k+1 will always succeed.
EXAMPLE
a(4) = 11 because the smallest not-yet-used palindromes (4, 5, 6, 7, 8, 9) multiplied by 3 are not base-10 palindromes, but 11*3 is.
PROG
(Python)
from itertools import count, islice, product
def ispal(n): s = str(n); return s == s[::-1]
def pals(): # generator of palindromes
digits = "0123456789"
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
an, aset = 1, {0, 1} # 0 is not allowed
yield 1
while True:
for p in pals():
if p not in aset and ispal(an*p):
an = p; aset.add(an); yield an; break
print(list(islice(agen(), 51))) # Michael S. Branicky, Apr 29 2022
CROSSREFS
Cf. A002113 (base-10 palindromes).
Sequence in context: A336876 A083664 A083125 * A031335 A084743 A030391
KEYWORD
nonn,base
AUTHOR
Eric Angelini and Hans Havermann, Feb 18 2020
STATUS
approved