login
A294022
Sum of the differences of the larger and smaller parts in the partitions of n into two parts with the larger part prime.
2
0, 0, 1, 2, 1, 4, 3, 8, 6, 4, 3, 12, 10, 20, 18, 16, 14, 28, 25, 40, 36, 32, 29, 48, 44, 40, 37, 34, 31, 56, 52, 78, 73, 68, 64, 60, 56, 88, 84, 80, 76, 112, 107, 144, 138, 132, 127, 168, 162, 156, 150, 144, 138, 184, 177, 170, 163, 156, 150, 202, 195, 248
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
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
Sequence in context: A370727 A193174 A126084 * A076077 A152194 A268630
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 21 2017
STATUS
approved