OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
127 is OK since 127 is p(31) and (p(n-1) + p(n+1)+ p(n+2))/p(n)=(113+131+137)/127=3. - Zak Seidov, Aug 04 2006
MAPLE
p:= 2: q:= 3: r:= 5: s:= 7:
count:= 0: Res:= NULL:
while count < 100 do
if p + r + s = 3*q then count:= count+1; Res:= Res, q fi;
p:= q; q:= r; r:= s; s:= nextprime(s)
od:
Res; # Robert Israel, May 06 2019
MATHEMATICA
a=Table[If[(Prime[n-3]+Prime[n-2]+Prime[n-1]+Prime[n])/4-Prime[n-2]==0, Prime[n-2], 0], {n, 4, 2004}] a0=Delete[Union[Sort[a]], 1]
Select[Prime[Range[2, 3000]], Prime[PrimePi[ # ]-1]+Prime[PrimePi[ # ]+1]+Prime[PrimePi[ # ]+2]==3#&] (* Zak Seidov, Aug 04 2006 *)
PROG
(Magma)
[NthPrime(n):n in [2..3000]|NthPrime(n-1)+NthPrime(n+1)+NthPrime(n+2)- 3*NthPrime(n) eq 0]; // Marius A. Burtea, May 06 2019
(MATLAB)
p=primes(30000);
m=1;
for u=2:length(p)-2
if p(u-1)+p(u+1)+p(u+2)-3*p(u)==0;
sol(m)=p(u); m=m+1;
end
end
sol % Marius A. Burtea, May 06 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Roger L. Bagula, Jun 17 2004
EXTENSIONS
More terms from Zak Seidov, Aug 04 2006
Edited by N. J. A. Sloane, Aug 08 2008
STATUS
approved