OFFSET
1,1
COMMENTS
LINKS
Karl V. Keller, Jr., Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Twin Primes
EXAMPLE
19890 is the average of the four consecutive primes 19867, 19889, 19891, 19913.
43890 is the average of the four consecutive primes 43867, 43889, 43891, 43913.
MATHEMATICA
{p, q, r, s} = {2, 3, 5, 7}; lst={}; While[p<5000000, If[Differences[{p, q, r, s}]=={22, 2, 22}, AppendTo[lst, q + 1]]; {p, q, r, s}={q, r, s, NextPrime@s}]; lst (* Vincenzo Librandi, Oct 14 2015 *)
PROG
(Python)
from sympy import isprime, prevprime, nextprime
for i in range(0, 5000001, 6):
if isprime(i-1) and isprime(i+1) and prevprime(i-1) == i-23 and nextprime(i+1) == i+23: print (i, end=', ')
(PARI) isok(n) = isprime(n-1) && isprime(n+1) && (precprime(n-2) == n-23) && (nextprime(n+2) == n+23); \\ Michel Marcus, Oct 14 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl V. Keller, Jr., Oct 13 2015
STATUS
approved