OFFSET
1,1
EXAMPLE
a(1) = 2 (prime) and a(1) + a(2) = 2 + 1 = 3 [which is prime, like a(1)];
a(2) = 1 (nonprime) and a(2) + a(3) = 1 + 3 = 4 [which is nonprime, like a(2)];
a(3) = 3 (prime) and a(3) + a(4) = 3 + 4 = 7 [which is prime, like a(3)];
a(4) = 4 (nonprime) and a(4) + a(5) = 4 + 5 = 9 [which is nonprime, like a(4)];
a(5) = 5 (prime) and a(5) + a(6) = 5 + 6 = 11 [which is prime, like a(5)];
(...)
a(8) = 7 (prime) and a(8) + a(9) = 7 + 40 = 47 [which is prime, like a(8)];
now we have to consider also the digits of the pair (7,4); they are "7", the last digit of a(8), and "4", the first digit of a(9): as the first digit of the pair is prime (7), the sum of this 7 and the next digit (4) has to be prime too, which is the case, 4 + 7 = 11;
a(9) = 40 (nonprime) and a(9) + a(10) = 40 + 9 = 49 [which is nonprime, like a(9)];
the next pair of digits we have to consider after (7,4) is (4,0); as 4 is nonprime, so has to be the sum 4 + 0 (which is the case as 4 + 0 = 4); etc.
MATHEMATICA
t[x_, y_]:=If[PrimeQ@x, PrimeQ[x+y], !PrimeQ[x+y]]; a[1]=2; a[n_]:=a[n]=Block[{k=1}, While[MemberQ[Array[a, n-1], k]||!And@@(t@@@Partition[Flatten[IntegerDigits/@Join[Array[a, n-1], {k}]], 2, 1])||!t@@{a[n-1], k}, k++]; k]; Array[a, 68] (* Giorgos Kalogeropoulos, May 09 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Aug 03 2021
STATUS
approved