OFFSET
1,1
COMMENTS
Is this sequence infinite?
See A383782 and the comment therein. - Michael S. Branicky, May 11 2025
EXAMPLE
127 is a term since 127 is a prime, 27 is a nonprime, and 7 is a prime;
13 is not a term since 13 and 3 are both prime.
MATHEMATICA
Unprotect[CompositeQ]; CompositeQ[1]:=True; Protect[CompositeQ]; Q[n_]:=And[AllTrue[FromDigits/@Table[Take[IntegerDigits[n], -i], {i, IntegerLength[n], 1, -2}], PrimeQ], AllTrue[FromDigits/@Table[Take[IntegerDigits[n], -i], {i, IntegerLength[n]-1, 1, -2}], CompositeQ]]; Select[Prime[Range[240]], Q]
PROG
(Python)
from gmpy2 import is_prime, mpz
from itertools import count, islice
def agen():
olst, elst = [2, 3, 5, 7], [11, 19, 29, 31, 41, 59, 61, 71, 79, 89]
for n in count(1):
yield from sorted(olst + elst)
olst2, elst2 = [], []
for o in olst:
o, base = o, 10**(2*n-1)
for i in range(10*base, 100*base, base):
t = i + o
t2 = int(str(t)[1:])
if is_prime(t) and not is_prime(t2):
olst2.append(t)
for e in elst:
e, base = e, 10**(2*n)
for i in range(10*base, 100*base, base):
t = i + e
t2 = int(str(t)[1:])
if is_prime(t) and not is_prime(t2):
elst2.append(t)
olst, elst = olst2, elst2
print(list(islice(agen(), 68))) # Michael S. Branicky, May 11 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Stefano Spezia, May 09 2025
STATUS
approved
