OFFSET
1,6
COMMENTS
Sum of the slopes of the tangent lines along the left side of the parabola b(x) = n*x-x^2 at prime values of x for x in 0 < x <= floor(n/2). For example, d/dx n*x-x^2 = n-2x. So for a(11), x=2,3,5 and so 11-2*2 + 11-2*3 + 11-2*5 = 7 + 5 + 1 = 13. - Wesley Ivan Hurt, Mar 24 2018
FORMULA
a(n) = Sum_{i=1..floor(n/2)} (n - 2i)*A010051(i).
First differences are A056172. - David A. Corneth, Apr 06 2018
a(n) = Sum_{i=1..n-1} pi(floor(i/2)), where pi(n) = A000720(n). - Ridouane Oudra, Nov 24 2019
EXAMPLE
The partitions of n = 11 into a number and a smaller prime number are 9 + 2, 8 + 3, and 6 + 5, so a(11) = (9 - 2) + (8 - 3) + (6 - 5) = 13. - Michael B. Porter, Apr 06 2018
MAPLE
with(numtheory): seq(add(pi(floor(i/2)), i=1..n-1), n=1..100); # Ridouane Oudra, Nov 24 2019
MATHEMATICA
Table[Sum[(n - 2 i) (PrimePi[i] - PrimePi[i - 1]), {i, Floor[n/2]}], {n, 60}]
PROG
(PARI) a(n) = sum(i=1, n\2, (n - 2*i)*isprime(i)); \\ Michel Marcus, Mar 24 2018
(PARI) a(n) = my(res = 0); forprime(p = 2, n >> 1, res += (n - p << 1)); res \\ David A. Corneth, Apr 06 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 21 2017
STATUS
approved