|
|
A368020
|
|
Palindromes which are a concatenation of three palindromes, each of which has at least 2 digits.
|
|
1
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Equivalently, these are palindromes which have a palindromic prefix of length at least 2 and no more than 1 less than half the total length. For example, 7 digit terms have the form (aa)(bcb)(aa) and 8 digit terms are of the form (aa)(bccb)(aa) or (aba)(cc)(aba).
|
|
LINKS
|
|
|
EXAMPLE
|
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).
|
|
PROG
|
(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)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|