OFFSET
0,1
COMMENTS
a(6681) is probably the only such term which equals zero.
LINKS
EXAMPLE
There are only two primes which are not the arithmetic mean of two other primes and they are 2 and 3. Therefore a(0)=3.
There are only three primes which are the arithmetic mean of two other primes in just one way. They are 5 = (3+7)/2, 7 = (3+11)/2, and 19 = (7+31)/2. Therefore a(1)=19.
There are only three primes which are the arithmetic mean of two other primes in just two ways. They are 11 = (3+19)/2 = (5+17)/2, 13 = (3+23)/2 = (7+19)/2, and 31 = (3+59)/2 = (19+43)/2. Therefore a(2)=31, etc.
MATHEMATICA
f[n_] := Block[{c = 0, k = 2, p = Prime@ n}, While[k + 1 < p, If[PrimeQ[p - k] && PrimeQ[p + k], c++ ]; k += 2]; c]; t = Table[0, {1000}]; Do[a = f@ n; If[a < 1001, t[[a + 1]] = Prime@ n; Print[{a, Prime@ n}]], {n, 5000}]; Take[t, 50]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Feb 25 2013
STATUS
approved