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.

A120639 Primes such that their quadruple is 1 away from a prime number.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 37, 41, 43, 53, 67, 71, 73, 79, 83, 97, 127, 131, 137, 139, 163, 173, 193, 197, 199, 227, 263, 277, 281, 293, 307, 373, 383, 409, 431, 433, 467, 487, 499, 503, 521, 563, 577, 587, 593, 617, 619, 673, 677, 683, 701, 709, 727, 739, 743, 797
Offset: 1

Views

Author

Cino Hilliard, Aug 17 2006

Keywords

Comments

This sequence is a variation of the sequence in the reference. However, this sequence should have an infinite number of terms. k=2 in the PARI code.

Examples

			17*4 = 68, one away from 67 which is prime.
		

References

  • R. Crandall and C. Pomerance, Prime Numbers A Computational Perspective, Springer Verlag 2002, p. 49, exercise 1.18.

Programs

  • Mathematica
    Select[Prime[Range[200]],Or@@PrimeQ[4#+{1,-1}]&] (* Harvey P. Dale, Feb 18 2013 *)
  • PARI
    primepm2(n,k) = \k = number of iterations,k = factor { local(x,p1,p2,f1,f2,r); if(k%2,r=2,r=1); for(x=1,n, p1=prime(x); p2=prime(x+1); if(isprime(p1*k+r)||isprime(p1*k-r), print1(p1",") ) ) }