OFFSET
1,1
EXAMPLE
71 is the first prime in the earliest sequence of 5 = 2 * 2 + 1 consecutive primes whose average is a prime, since (71 + 73 + 79 + 83 + 89)/5 = 79. Therefore a(2) = 71.
MATHEMATICA
f[n_] := Block[{k = 1}, While[ !PrimeQ[ Sum[ Prime[j], {j, k, 2n + k}]/(2n + 1)], k++ ]; Prime[k]]; Table[ f[n], {n, 52}] (* Robert G. Wilson v, Jun 21 2005 *)
Module[{prs=Prime[Range[25000]]}, Table[SelectFirst[Partition[ prs, 2n+1, 1], PrimeQ[ Mean[ #]]&], {n, 60}]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 25 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jun 16 2005
EXTENSIONS
More terms from Robert G. Wilson v, Jun 21 2005
STATUS
approved