The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A357314 a(1) = 1; a(n) is the second smallest number k such that k > a(n-1) and concatenation of a(1), ..., a(n-1), k is a palindrome. 0
1, 21, 1121, 1211121, 2111211211121, 112112111212111211211121, 12111212111211211121112112111212111211211121, 211121121112111211211121211121121112112111212111211211121112112111212111211211121 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Conjecture: Length A055642(a(n)) = A000073(n+2), and A305393 is a sequence of digits in the concatenation of all terms in this sequence.
LINKS
EXAMPLE
For n = 3 concatenation of the previous terms is 121. Numbers that would make it a palindrome if concatenated to it are 121, 1121, ... and the second smallest of them is a(3) = 1121.
PROG
(Python)
pal = lambda s: s == s[::-1]
up_to = 10
terms = [1, ]
for i in range(up_to-1):
c, r = ''.join(map(str, terms)), 0
for j in range(len(str(terms[-1])), len(c)+1):
found, p = False, int(c[:j][::-1])
if p > terms[-1] and pal(c + c[:j][::-1]):
r+=1
if r == 2:
terms.append(p); found = True; break
if found: continue
j = 0
while 1:
j+=1
r+=1
if r == 2:
terms.append(int(str(j) + c[::-1]))
break
print(terms)
CROSSREFS
Sequence in context: A193156 A012183 A012230 * A270505 A086098 A086875
KEYWORD
nonn,base
AUTHOR
Gleb Ivanov, Sep 23 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 11:25 EDT 2024. Contains 372712 sequences. (Running on oeis4.)