OFFSET
1,1
LINKS
Karl V. Keller, Jr., Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Twin Primes
EXAMPLE
3390 is the average of the four consecutive primes 3373, 3389, 3391, 3407.
66570 is the average of the four consecutive primes 66553, 66569, 66571, 66587.
MATHEMATICA
Select[Prime@ Range@ 50000, NextPrime[#, {1, 2, 3}] == {16, 18, 34} + # &] + 17 (* Giovanni Resta, Sep 14 2015 *)
PROG
(Python)
from sympy import isprime, prevprime, nextprime
for i in range(0, 3000001, 6):
..if isprime(i-1) and isprime(i+1) and prevprime(i-1)==i-17 and nextprime(i+1)==i+17 : print (i, end=', ')
(PARI) list(l)=for(i=1, l, p=prime(i); if(p+16==prime(i+1)&&p+18==prime(i+2)&&p+34==prime(i+3), print1(p+17, ", "))) \\ Anders Hellström, Sep 14 2015
(Perl) use ntheory ":all"; say $_+1 for grep { next_prime($_+2)-$_ == 18 && $_-prev_prime($_) == 16} @{twin_primes(1e9)}; # Dana Jacobsen, Oct 13 2015
(Perl) use ntheory ":all"; say $_+17 for grep { next_prime($_+0)-$_ == 16 && next_prime($_+18)-$_ == 34} sieve_prime_cluster(1, 1e9, 16, 18, 34); # Dana Jacobsen, Oct 13 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl V. Keller, Jr., Sep 13 2015
STATUS
approved