A368020 Palindromes which are a concatenation of three palindromes, each of which has at least 2 digits.
110011, 111111, 112211, 113311, 114411, 115511, 116611, 117711, 118811, 119911, 220022, 221122, 222222, 223322, 224422, 225522, 226622, 227722, 228822, 229922, 330033, 331133, 332233, 333333, 334433, 335533, 336633, 337733, 338833, 339933, 440044, 441144, 442244
Offset: 1
Examples
110011 is a term since it is a palindrome, and consists of 3 palindromes: (11)(00)(11). 9999999 is a term and its constituent 3 palindromes can be listed in three ways: (99)(999)(99), (999)(99)(99), and (99)(99)(999).
Links
- James S. DeArmon, Python code
Programs
-
Python
# see Link
-
Python
from itertools import count, islice, product def pals(d=2): # generator of palindromes with d >=2 digits as strings yield from (f+(s:="".join(r))+m+s[::-1]+f for f in "123456789" for r in product("0123456789", repeat=d//2-1) for m in [[""], "0123456789"][d%2]) def agen(): # generator of terms yield from (int("".join(p)) for d in count(6) for p in pals(d) if any((s:=p[:i])==s[::-1] for i in range(2, d//2))) print(list(islice(agen(), 33))) # Michael S. Branicky, Jan 23 2024
Comments