OFFSET
1,2
COMMENTS
The integer 10 is the first one that will never appear in the sequence (as the result of 1 + 2*0 is not a prime). The next absent will be 14.
From Michael S. Branicky, Apr 19 2023: (Start)
The only allowed pairs of digits AB are 01, 11, 12, 13, 15, 16, 18, 19, 20, 30, 31, 32, 34, 35, 37, 38, 50, 51, 53, 54, 56, 57, 59, 70, 72, 73, 75, 76, 78, 91, 92, 94, 95, 97.
Further, any appearance of 4, 6, or 8 as a digit would end the sequence, as would a term with last digit 2 (since the next term cannot start with 0).
As long as no term ends in 2, 4, 6, or 8, the sequence is infinitely extensible since the edge and cycle 01 -> 13 -> 31 -> 13 (at least) can be used to extend terms ending in 0, 1, or 3; and 75 -> 59 -> 97 to extend terms ending in 5, 7, or 9. (End)
EXAMPLE
Digit A = 1 and B = 3 lead to 7 (prime) = A+2B;
Digit A = 3 and B = 5 lead to 13 (prime) = A+2B;
Digit A = 5 and B = 7 lead to 19 (prime) = A+2B;
Digit A = 7 and B = 2 lead to 11 (prime) = A+2B;
Digit A = 2 and B = 0 lead to 2 (prime) = A+2B;
Digit A = 0 and B = 1 lead to 2 (prime) = A+2B;
Digit A = 1 and B = 1 lead to 3 (prime) = A+2B; etc.
PROG
(Python)
from sympy import isprime
from itertools import islice
def c(s):
if s[-1] == "2" or "4" in s or "6" in s or "8" in s: return False
return all(isprime(int(s[i])+2*int(s[i+1])) for i in range(len(s)-1))
def agen(): # generator of terms
last, aset = "1", {1}
yield 1
while True:
k = 2
while k in aset or not c(last+str(k)): k += 1
an = k; yield an; last += str(an); aset.add(an)
print(list(islice(agen(), 58))) # Michael S. Branicky, Apr 19 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Apr 19 2023
EXTENSIONS
a(7) inserted and a(30) and beyond from Michael S. Branicky, Apr 19 2023
STATUS
approved