cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A086244 Primes such that a sum of any two adjacent digits is prime; first and last digits are considered adjacent.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Jul 13 2003

Keywords

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.

Examples

			2029 is a term because it is a prime and 2+0, 0+2, 2+9, 9+2 are all primes.
		

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