OFFSET
1,4
COMMENTS
Sum of the slopes of the tangent lines along the left side of the parabola b(x) = n*x-x^2 such that n-x is prime for x in 0 < x <= floor(n/2). For example, d/dx n*x-x^2 = n-2x. So for a(12), the integer values of x which make 12-x prime are x=1,5 and so a(12) = 12-2*1 + 12-2*5 = 10 + 2 = 12. - Wesley Ivan Hurt, Mar 24 2018
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{i=1..floor(n/2)} (n - 2i) * A010051(n - i).
EXAMPLE
There are two ways to partition n = 9 into a prime and a smaller positive integer: 7 + 2 and 5 + 4. So a(9) = (7 - 2) + (5 - 4) = 6. - Michael B. Porter, Mar 26 2018
MATHEMATICA
Table[Sum[(n - 2 i) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[n/2]}], {n, 60}]
PROG
(PARI) a(n) = sum(i=1, n\2, (n - 2*i)*isprime(n-i)); \\ Michel Marcus, Mar 24 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 21 2017
STATUS
approved