login
A343782
Sum of the positive differences of the prime pairs (p,q) such that n = p + q and p <= q.
0
0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 0, 2, 9, 8, 11, 16, 0, 12, 15, 20, 17, 28, 0, 26, 21, 32, 0, 24, 0, 28, 27, 32, 29, 64, 0, 60, 0, 24, 35, 58, 0, 72, 39, 86, 41, 88, 0, 122, 45, 116, 0, 78, 0, 128, 51, 98, 0, 108, 0, 144, 57, 80, 59, 202, 0, 204, 0, 60, 65, 184, 0, 216, 69, 188
OFFSET
1,7
COMMENTS
From Bernard Schott, May 01 2021: (Start)
a(n) = 0 iff n is in A166081.
a(n) is odd iff n is A048974. (End)
FORMULA
a(n) = Sum_{i=1..floor(n/2)} c(i) * c(n-i) * (n-2*i), where c is the prime characteristic (A010051).
EXAMPLE
a(16) = 16; We have (3,13) and (5,11). The sum of the positive differences is (13-3) + (11-5) = 10 + 6 = 16.
MATHEMATICA
Table[Sum[(n - 2 i) (PrimePi[i] - PrimePi[i - 1]) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[n/2]}], {n, 100}]
PROG
(PARI) a(n) = my(s=0); forprime(p=1, n\2, if (isprime(n-p), s += n-2*p)); s; \\ Michel Marcus, May 01 2021
CROSSREFS
Sequence in context: A130912 A178844 A210714 * A363447 A371905 A371908
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Apr 29 2021
STATUS
approved