OFFSET
1,1
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
p = 79 = (71 + 73 + 79 + 83 + 89)/5 = 395/5 i.e. it is both the arithmetic mean and median.
MATHEMATICA
Do[s3=Prime[n]+Prime[n+1]+Prime[n+2]; s5=Prime[n-1]+s3+Prime[n+3]; If[Equal[s5/5, Prime[n+1]], Print[Prime[n+1]]], {n, 3, 3000}]
Select[Partition[Prime[Range[1500]], 5, 1], Mean[#]==#[[3]]&][[All, 3]] (* Harvey P. Dale, Nov 04 2019 *)
PROG
(PARI) p=2; q=3; r=5; s=7; forprime(t=11, 1e9, if(p+q+s+t==4*r, print1(r", ")); p=q; q=r; r=s; s=t) \\ Charles R Greathouse IV, Nov 20 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 08 2003
STATUS
approved