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
20982 is the average of the four consecutive primes 20963, 20981, 20983, 21001.
28182 is the average of the four consecutive primes 28163, 28181, 28183, 28201.
MATHEMATICA
Select[Range[6, 600000, 6], And[AllTrue[{# - 1, # + 1}, PrimeQ], NextPrime[# - 1, -1] == # - 19, NextPrime[# + 1] == # + 19] &] (* Michael De Vlieger, Sep 27 2015, Version 10 *)
Select[Prime@Range@60000, NextPrime[#, {1, 2, 3}] == {18, 20, 38} + # &] + 19 (* Vincenzo Librandi, Oct 10 2015 *)
Mean/@Select[Partition[Prime[Range[50000]], 4, 1], Differences[#]=={18, 2, 18}&] (* Harvey P. Dale, Jan 16 2019 *)
PROG
(Python)
from sympy import isprime, prevprime, nextprime
for i in range(0, 1000001, 6):
..if isprime(i-1) and isprime(i+1):
....if prevprime(i-1) == i-19 and nextprime(i+1) == i+19 : print(i, end=', ')
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl V. Keller, Jr., Sep 26 2015
STATUS
approved