OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..3650
EXAMPLE
47961 is in the sequence because 47961 = 219^2 = (47951+47963+47969)/3, the arithmetic mean of three consecutive primes.
131769 is in the sequence because 131769 = 363^2 = (131759+131771+131777)/3, the arithmetic mean of three consecutive primes.
MAPLE
with(numtheory):KD := proc() local a, b, d, e, f; a:=n^2; b:=prevprime(a); d:=nextprime(a); e:=nextprime(d); f:=(b+d+e)/3; if a=f then RETURN (a); fi; end: seq(KD(), n=2..10000);
MATHEMATICA
amQ[{a_, b_, c_}]:=Module[{m=Mean[{a, b, c}]}, IntegerQ[Sqrt[m]]&&a<m<b<c]; Mean/@Select[Partition[Prime[Range[2100000]], 3, 1], amQ] (* Harvey P. Dale, Mar 14 2014 *)
PROG
(PARI) list(lim)=my(v=List(), p=2, q=3, t); forprime(r=5, nextprime(nextprime(lim+1)+1), t=(p+q+r)/3; if(denominator(t)==1 && issquare(t) && t < q, listput(v, t)); p=q; q=r); Vec(v) \\ Charles R Greathouse IV, Jan 03 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Dec 22 2013
EXTENSIONS
Definition corrected by Michel Marcus and Charles R Greathouse IV, Jan 03 2014
STATUS
approved