A294022 Sum of the differences of the larger and smaller parts in the partitions of n into two parts with the larger part prime.
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
Examples
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
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1000
- Index entries for sequences related to partitions
Programs
-
Mathematica
Table[Sum[(n - 2 i) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[n/2]}], {n, 60}]
-
PARI
a(n) = sum(i=1, n\2, (n - 2*i)*isprime(n-i)); \\ Michel Marcus, Mar 24 2018
Formula
a(n) = Sum_{i=1..floor(n/2)} (n - 2i) * A010051(n - i).
Comments