OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..2869
EXAMPLE
15876 is in the sequence because 15876 = 126^2 = (15859+15877+15881+15887)/4, the arithmetic mean of four consecutive primes.
35721 is in the sequence because 35721 = 189^2 = (35677+35729+35731+35747)/4, the arithmetic mean of four consecutive primes.
MAPLE
KD := proc() local a, b, d, e, f, g; a:=n^2; b:=prevprime(a); d:=nextprime(a); e:=nextprime(d); f:=nextprime(e); g:=(b+d+e+f)/4; if a=g then RETURN (a); fi; end: seq(KD(), n=2..10000);
MATHEMATICA
fcpQ[{a_, b_, c_, d_}]:=Module[{m=Mean[{a, b, c, d}]}, IntegerQ[ Sqrt[ m]] && a< m< b]; Mean/@Select[Partition[Prime[Range[1600000]], 4, 1], fcpQ] (* Harvey P. Dale, Apr 24 2017 *)
PROG
(PARI) list(lim)=my(v=List(), p=2, q=3, r=5, t); forprime(s=7, nextprime(nextprime(lim+1)+1), t=(p+q+r+s)/4; if(denominator(t)==1 && issquare(t) && t < q, listput(v, t)); p=q; q=r; r=s); Vec(v) \\ Charles R Greathouse IV, Jan 03 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Dec 23 2013
EXTENSIONS
Definition corrected by Michel Marcus and Charles R Greathouse IV, Jan 03 2014
STATUS
approved