OFFSET
1,1
COMMENTS
Each (2- or more-digit) term must begin with one of the even digits 2,4,6,8 or else must begin and end with the digit 1. All repunit primes (A004022) are terms as the sums are always 2.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 623 terms from Zak Seidov)
EXAMPLE
2029 is a term because it is a prime and 2+0, 0+2, 2+9, 9+2 are all primes.
MATHEMATICA
p=10; Reap[Do[Label[ne]; p=NextPrime[p]; id=IntegerDigits[p];
id1=Append[id, id[[1]]]; id2=Prepend[id, id[[-1]]];
If[{True}==Union[PrimeQ[id1+id2]], Sow[p]], {2000}]][[2, 1]]
(* Zak Seidov, May 10 2016 *)
tadpQ[n_]:=Module[{idn=IntegerDigits[n]}, AllTrue[ Join[{idn[[1]]+ idn[[-1]]}, Total/@Partition[idn, 2, 1]], PrimeQ]]; Select[Prime[Range[ 2500]], tadpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 08 2019 *)
CROSSREFS
KEYWORD
easy,base,nonn
AUTHOR
Zak Seidov, Jul 13 2003
EXTENSIONS
Corrected and extended by Rick L. Shepherd, Feb 11 2004
STATUS
approved