login
A367431
Write down the positive integers. To obtain the terms of the sequence, concatenate groups of these so that the last number of each concatenated group is a prime.
1
12, 3, 45, 67, 891011, 1213, 14151617, 1819, 20212223, 242526272829, 3031, 323334353637, 38394041, 4243, 44454647, 484950515253, 545556575859, 6061, 626364656667, 68697071, 7273, 747576777879, 80818283, 848586878889, 9091929394959697, 9899100101, 102103
OFFSET
1,1
LINKS
PROG
(Python)
from sympy import prime
from itertools import count, islice
def a(n):
return int("".join(map(str, range(1 if n<2 else prime(n-1)+1, prime(n)+1))))
print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Nov 18 2023
(Python) # faster for generating initial segment of sequence
from sympy import isprime
from itertools import count, islice
def agen():
cat = ""
for i in count(1):
cat += str(i)
if isprime(i): yield int(cat); cat = ""
print(list(islice(agen(), 30))) # Michael S. Branicky, Nov 18 2023
CROSSREFS
Sequence in context: A248171 A258227 A130895 * A038329 A098909 A261403
KEYWORD
nonn,base
AUTHOR
Tamas Sandor Nagy, Nov 18 2023
STATUS
approved