A086244 Primes such that a sum of any two adjacent digits is prime; first and last digits are considered adjacent.
11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 211, 2029, 2111, 2129, 2141, 2143, 2161, 2341, 2383, 2389, 2503, 2521, 4111, 4129, 4349, 4703, 4943, 6121, 6521, 6761, 8329, 8389, 8923, 8929, 11161, 11411, 12161, 12941, 14321, 14341, 14741, 16111, 16141, 16561, 16741, 20323, 20341, 20389, 20521
Offset: 1
Examples
2029 is a term because it is a prime and 2+0, 0+2, 2+9, 9+2 are all primes.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 623 terms from Zak Seidov)
Programs
-
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 *)
Extensions
Corrected and extended by Rick L. Shepherd, Feb 11 2004
Comments