OFFSET
1,1
COMMENTS
The 13 pseudoquadprimes listed are for primes less than 50000. There are 693 quadprimes less than 50000. So the chance is very good for prime p and p+4 to be quadprimes if p+4 divides p^(p+4) + 4. In general, if p and p+k are both prime then p+k divides p^(p+k)+k. If we do not know if p+k is prime and p+k divides p^(p+k) + k, then it is probable that p+k is prime. However, we get surprises such as for k=64 we get 32 pseudo64primes less than 10000 while k=40 produces 4.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..3000
FORMULA
If p is prime and p+4 is prime then p and p+4 form a quad prime pair. In general, if p is prime and p+k is prime then p and p+k form a k difference prime pair. If p is prime and p+k divides p^(p+k) + k then it is likely that p+k is prime. If p+k is composite and divides p^(p+k) + k, then p+k is a pseudokprime.
EXAMPLE
p=7, p+4 = 11. (7^11+4)/11 = 179756977 so 11 prime, is not in the sequence.
p=11,p+4 = 15. (11^15+4)/11 = 278483211294377 so 15 composite is in the sequence.
MATHEMATICA
lst = {}; Do[q = p + 4; If[! PrimeQ[q] && PowerMod[p, q, q] == p, AppendTo[lst, q]], {p, Prime@Range[2^16]}]; lst (* Arkadiusz Wesolowski, Jun 01 2013 *)
PROG
(PARI) ktokpk(n=1, n2, k=4) = { local(x, y, x2); forprime(x=n, n2, x2=x+k; y=x^x2+k; if(y%x2==0&!isprime(x2), print1(x2, ", "); ); ); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Jan 09 2005
EXTENSIONS
Offset corrected and more terms from Arkadiusz Wesolowski, Jun 01 2013
STATUS
approved