cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A368020 Palindromes which are a concatenation of three palindromes, each of which has at least 2 digits.

This page as a plain text file.
%I A368020 #76 Feb 16 2024 14:25:11
%S A368020 110011,111111,112211,113311,114411,115511,116611,117711,118811,
%T A368020 119911,220022,221122,222222,223322,224422,225522,226622,227722,
%U A368020 228822,229922,330033,331133,332233,333333,334433,335533,336633,337733,338833,339933,440044,441144,442244
%N A368020 Palindromes which are a concatenation of three palindromes, each of which has at least 2 digits.
%C A368020 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).
%H A368020 James S. DeArmon, <a href="/A368020/a368020.py.txt">Python code</a>
%e A368020 110011 is a term since it is a palindrome, and consists of 3 palindromes: (11)(00)(11).
%e A368020 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).
%o A368020 (Python) # see Link
%o A368020 (Python)
%o A368020 from itertools import count, islice, product
%o A368020 def pals(d=2): # generator of palindromes with d >=2 digits as strings
%o A368020     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])
%o A368020 def agen(): # generator of terms
%o A368020     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)))
%o A368020 print(list(islice(agen(), 33))) # _Michael S. Branicky_, Jan 23 2024
%Y A368020 Cf. A002113 (palindromes), A344550.
%K A368020 base,nonn
%O A368020 1,1
%A A368020 _James S. DeArmon_, Dec 23 2023