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!)
A360225 a(1) = 2, a(2) = 3, a(n) = the smallest prime whose digits consist of a(n-2), followed by zero or more digits, followed by a(n). 0
2, 3, 23, 3023, 2393023, 3023172393023, 2393023313023172393023, 3023172393023282393023313023172393023, 239302331302317239302383023172393023282393023313023172393023 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(4) = 3023 because int(concat('3', '23')) is not prime, and int(concat('3', '0', '23')) is prime.
PROG
(Python)
from sympy import isprime
max_n = 10
prev_prev = 2
prev = 3
seq = [prev_prev, prev]
for n in range(3, max_n+1):
result = int(str(prev_prev) + str(prev))
if not isprime(result):
middle_length = 1
keep_searching = True
while keep_searching:
for middle in range(0, 10**middle_length):
result = int(str(prev_prev) + str(middle).zfill(middle_length) + str(prev))
if isprime(result):
keep_searching = False
break
middle_length = middle_length + 1
seq.append(result)
prev_prev = prev
prev = result
print(seq)
CROSSREFS
Sequence in context: A092388 A225726 A076530 * A238265 A203015 A260420
KEYWORD
nonn,base
AUTHOR
Robert C. Lyons, Jan 30 2023
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 April 28 15:29 EDT 2024. Contains 372088 sequences. (Running on oeis4.)