OFFSET
1,2
COMMENTS
Two distinct terms can always be concatenated in some way to form a prime number.
Is this sequence infinite?
LINKS
EXAMPLE
The following concatenations are prime:
- j=2: a(1) U a(2)=13, a(2) U a(1)=31
- j=3: a(3) U a(1)=41, a(3) U a(2)=43
- j=4: a(1) U a(4)=17, a(4) U a(1)=71, a(2) U a(4)=37, a(4) U a(2)=73, a(3) U a(4)=47
- j=5: a(5) U a(1)=191, a(5) U a(2)=193, a(3) U a(5)=419, a(4) U a(5)=719, a(5) U a(4)=197
- j=6: a(1) U a(6)=131, a(6) U a(1)=311, a(2) U a(6)=331, a(6) U a(2)=313, a(3) U a(6)=431, a(6) U a(4)=317, a(5) U a(6)=1931, a(6) U a(5)=3119
PROG
(PARI) See Link section.
(Python)
from sympy import isprime
from itertools import islice
def c(s, slst):
return all(isprime(int(s+t)) or isprime(int(t+s)) for t in slst)
def agen():
slst, an, mink = [], 1, 2
while True:
yield an; slst.append(str(an)); an += 1
while not c(str(an), slst): an += 1
print(list(islice(agen(), 10))) # Michael S. Branicky, Oct 17 2022
CROSSREFS
KEYWORD
base,nonn,more
AUTHOR
Paul Tek, Nov 16 2014
EXTENSIONS
a(15) from Michael S. Branicky, Nov 07 2022
STATUS
approved