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
FORMULA
a(n) = A052378(n) + 5. - Karl V. Keller, Jr., Jul 17 2015
EXAMPLE
12 is the average of the four consecutive primes 7, 11, 13, 17.
18 is the average of the four consecutive primes 13, 17, 19, 23.
MATHEMATICA
a={}; Do[If[Prime[x + 3] - Prime[x]==10, AppendTo[a, Prime[x]+ 5]], {x, 1, 4000}]; a (* Vincenzo Librandi, Jul 18 2015 *)
Mean/@Select[Partition[Prime[Range[3000]], 4, 1], Differences[#]=={4, 2, 4}&] (* Harvey P. Dale, Sep 18 2018 *)
PROG
(Python)
from sympy import isprime, prevprime, nextprime
for i in range(0, 50001, 2):
..if isprime(i-1) and isprime(i+1):
....if prevprime(i-1) == i-5 and nextprime(i+1) == i+5: print (i, end=', ')
(PARI) is(n)=isprime(n-5)&&isprime(n-1)&&isprime(n+1)&&isprime(n+5) \\ Charles R Greathouse IV, Aug 28 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl V. Keller, Jr., May 19 2015
EXTENSIONS
New name from Karl V. Keller, Jr., Jul 21 2015
STATUS
approved