OFFSET
2,2
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
Wikipedia, Balanced prime
MAPLE
p:= 2: q:= 3: r:= 5:
for i from 2 to 200 do
t:= q - (p+r)/2;
A[i]:= piecewise(t<0, 1, t=0, 2, 3);
p:= q; q:= r; r:= nextprime(r);
od:
seq(A[i], i=2..200); # Robert Israel, Mar 25 2018
MATHEMATICA
A108415[n_]:=2+Sign[Prime[n]-1/2(Prime[n-1]+Prime[n+1])]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 02 2005
STATUS
approved