OFFSET
1,1
COMMENTS
Except for the second entry, the sequence also holds with respect to A077018.
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = (prime(n+1) - prime(n-1))/2 for n>=3. - Nathaniel Johnston, Jun 25 2011
EXAMPLE
The 5th prime number, 11, appears three times in A051697. Therefore a(5) = 3.
MATHEMATICA
a = {3}; For[n = 2, n < 100, n++, c = 0; For[j = Prime[n - 1], j < Prime[n + 1], j++, If[j < Prime[n], If[Prime[n] - j < j - Prime[n - 1], c++ ], If[Not[Prime[n + 1] - j < j - Prime[n]], c++ ]]]; AppendTo[a, c]]; a
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lekraj Beedassy, Mar 01 2006
EXTENSIONS
Edited and extended by Stefan Steinerberger, Oct 27 2007
STATUS
approved