OFFSET
1,1
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.
REFERENCES
R. Crandall and C. Pomerance, Prime Numbers A Computational Perspective, Springer Verlag 2002, p. 49, exercise 1.18.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
17*4 = 68, one away from 67 which is prime.
MATHEMATICA
Select[Prime[Range[200]], Or@@PrimeQ[4#+{1, -1}]&] (* Harvey P. Dale, Feb 18 2013 *)
PROG
(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", ") ) ) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Aug 17 2006
STATUS
approved