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.

A105412 Primes p = prime(k) such that both p+2 and prime(k+5)-2 are prime numbers.

Original entry on oeis.org

5, 41, 179, 197, 281, 599, 641, 809, 827, 857, 1061, 1451, 2237, 2549, 3119, 3329, 3359, 3821, 4001, 4091, 4217, 5417, 5441, 5849, 6269, 6659, 6761, 6791, 7457, 7949, 8387, 8597, 9239, 9419, 9431, 9677, 10301, 10427, 10859, 10889, 11117, 11717
Offset: 1

Views

Author

Cino Hilliard, May 02 2005

Keywords

Comments

Conjecture: There are infinitely many primes p(k) such that p(k)+2 and p(k+m)-2 are both primes for all m > 1.

Examples

			prime(13) = 41, and both prime(13)+2 = 43 and prime(13+5)-2 = 59 are primes, so 41 is in the sequence.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [1..1500] | IsPrime(NthPrime(n)+2) and IsPrime(NthPrime(n+5)-2)]; // Vincenzo Librandi, Sep 14 2015
  • Mathematica
    For[n = 1, n < 500, n++, If[PrimeQ[Prime[n] + 2], If[PrimeQ[Prime[n + 5] - 2], Print[Prime[n]]]]] (* Stefan Steinerberger, Feb 07 2006 *)
  • PARI
    pnpk(n, m=5, k=2) = { local(x, v1, v2); for(x=1, n, v1 = prime(x)+ k; v2 = prime(x+m)-k; if(isprime(v1)&isprime(v2), print1(prime(x), ", ") ) ) ;} \\ corrected by Michel Marcus, Sep 14 2015
    
  • PARI
    lista(pmax) = {my(k = 1, p = primes(6)); forprime(p1 = p[#p], pmax, k++; p[#p] = p1; if(p[2]- p[1] == 2 && p[6] - p[5] == 2, print1(p[1], ", ")); for(i = 1, #p-1, p[i] = p[i+1]));} \\ Amiram Eldar, Oct 04 2024