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.

Showing 1-1 of 1 results.

A065117 Primes such that prime(p) +- pi(p) are simultaneously prime.

Original entry on oeis.org

3, 113, 463, 593, 743, 1109, 2473, 4139, 4657, 4937, 5531, 5879, 6473, 6581, 6659, 6701, 7297, 7529, 8387, 8521, 8929, 9349, 10369, 10499, 12289, 12829, 13411, 13697, 14033, 14323, 15907, 18637, 19391, 19841, 21143, 21647, 23021, 27077
Offset: 1

Views

Author

Robert G. Wilson v, Nov 12 2001

Keywords

Comments

Intersection of A065059 and A065060.

Examples

			113 is in the sequence because PrimePi(113) is 30, Prime(113) is 617, and both 587 and 647 are primes.
		

Crossrefs

Programs

  • Mathematica
    Do[p0 = Prime[ Prime[n]]; p1 = PrimePi[ Prime[n]]; If[ PrimeQ[p0 + p1] && PrimeQ[p0 - p1], Print[ Prime[n]]], {n, 1, 5000} ]
    spQ[n_]:=Module[{p=PrimePi[n]},AllTrue[Prime[n]+{p,-p},PrimeQ]]; Select[ Prime[ Range[10000]],spQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 03 2018 *)
  • PARI
    { n=0; default(primelimit, 4294965247); for (m=1, 10^9, p=prime(m); p0 = prime(p); p1 = primepi(p); if (isprime(p0 + p1) && isprime(p0 - p1), write("b065117.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 10 2009

Extensions

Example corrected by Harvey P. Dale, Sep 03 2018
Showing 1-1 of 1 results.