OFFSET
1,5
COMMENTS
The plot is very interesting.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
a(A178953(n)) = 0.
EXAMPLE
a(3)=1 because 5=prime(3)=(prime(3-1)+prime(3+1))/2=(3+7)/2.
MATHEMATICA
Table[k=n-1; While[Prime[n-k]+Prime[n+k] != 2*Prime[n], k--]; k, {n, 100}]
PROG
(Sage)
def A178609(n):
return next(k for k in range(n)[::-1] if nth_prime(n-k)+nth_prime(n+k) == 2*nth_prime(n))
# D. S. McNeil, Dec 29 2010
(Haskell)
a178609 n = head [k | k <- [n - 1, n - 2 .. 0], let p2 = 2 * a000040 n,
a000040 (n - k) + a000040 (n + k) == p2]
-- Reinhard Zumkeller, Jan 30 2014
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Juri-Stepan Gerasimov, Dec 24 2010
EXTENSIONS
Extended and corrected by T. D. Noe, Dec 28 2010
STATUS
approved