login
A389791
a(n) is the smallest nonprime such that a suffix of a(n) concatenated with a prefix of a(n+1) gives prime(n+4).
1
1, 1, 301, 711, 92, 32, 93, 123, 74, 14, 34, 75, 35, 96, 16, 77, 117, 327, 98, 38, 9, 710, 10, 310, 710, 91, 1311, 2701, 3101, 371, 391, 4901, 51, 5716, 301, 671, 731, 791, 81, 91, 931, 9701, 992, 112, 232, 272, 292, 332, 392, 412, 512, 572, 632, 692, 712, 772
OFFSET
1,3
LINKS
PROG
(Python)
from sympy import isprime, nextprime
from itertools import count, islice, product
def agen(): # generator of terms
an, t1, t2 = 1, "11", "13"
while True:
yield an
s = str(an)
for an in count(1):
if not isprime(an):
u = str(an)
if t1 not in s+u: continue
if any(s[i:]+u[:j] == t1 and t2.startswith(u[k:]) and t2[len(u[k:])]!= '0' for i in range(len(s)) for j in range(1, len(u)+1) for k in range(len(u))):
break
t1, t2 = t2, str(nextprime(int(t2)))
print(list(islice(agen(), 56))) # Michael S. Branicky, Oct 15 2025
CROSSREFS
Cf. A000040.
Sequence in context: A297913 A298506 A282769 * A256101 A070192 A298326
KEYWORD
nonn,base
AUTHOR
Tamas Sandor Nagy, Oct 15 2025
EXTENSIONS
Terms corrected by Michael S. Branicky, Oct 15 2025
STATUS
approved