OFFSET
1,1
COMMENTS
This sequence is a subsequence A014574 (average of twin prime pairs).
All terms are multiples of 6. - Zak Seidov, Apr 25 2015
LINKS
Karl V. Keller, Jr., Table of n, a(n) for n = 1..500000
Eric Weisstein's World of Mathematics, Twin Primes
EXAMPLE
For n=12: 5,7,11,13,17,19 are six consecutive primes with 13 = 11 + 2 and (5+7+17+19)/4=12.
For n=1032: 1019,1021,1031,1033,1039,1049 are six consecutive primes with 1033 = 1031 + 2 and (1019+1021+1039+1049)/4=1032.
MATHEMATICA
avQ[lst_]:=Module[{td=TakeDrop[lst, {3, 4}]}, Mean[td[[1]]]==Mean[td[[2]]] && td[[1, 2]]-td[[1, 1]]==2]; Mean[Take[#, {3, 4}]]&/@Select[Partition[ Prime[ Range[ 3500]], 6, 1], avQ] (* The program uses the TakeDrop function from Mathematica version 10.2 *) (* Harvey P. Dale, Jul 16 2015 *)
PROG
(Python)
from sympy import isprime, prevprime, nextprime
for i in range(5, 200001, 2):
..if isprime(i) and isprime(i+2):
....a = prevprime(i)
....b = prevprime(a)
....if a+b+nextprime(i, 2)+nextprime(i, 3) == 4*(i+1): print(i+1, end=', ')
..else: continue
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl V. Keller, Jr., Apr 24 2015
EXTENSIONS
Typo in Name fixed by Zak Seidov, Apr 25 2015
STATUS
approved