login
A107599
a(n) = 0,1,2 (resp.) if (1/2)[prime(n-1)+prime(n+1)] is less than, equal to or greater than prime(n) (resp.).
1
2, 1, 2, 0, 2, 0, 2, 2, 0, 2, 0, 0, 2, 2, 1, 0, 2, 0, 0, 2, 0, 2, 2, 0, 0, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 0, 2, 1, 0, 0, 2, 2, 0, 2, 0, 1, 1, 0, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 2, 2, 2, 0, 1, 0, 2, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 0, 2, 2, 0, 2, 0
OFFSET
2,1
LINKS
EXAMPLE
Prime[100]=541, (Prime[100 - 1] + Prime[100 + 1])/2=(523+547)/2=535<541, hence a(100)=0.
MATHEMATICA
Table[If[(Prime[n-1]+Prime[n+1])/2<Prime[n], 0, If[(Prime[n-1]+Prime[n+1])/2==Prime[n], 1, 2]], {n, 2, 100}]
w[{a_, b_, c_}]:=With[{x=Floor[a+c]/2}, Which[x<b, 0, x==b, 1, True, 2]]; w/@Partition[Prime[Range[110]], 3, 1] (* Harvey P. Dale, Oct 05 2024 *)
CROSSREFS
Sequence in context: A117169 A274263 A046920 * A156836 A287438 A079483
KEYWORD
nonn
AUTHOR
Zak Seidov, May 17 2005
STATUS
approved