Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 May 01 2021 13:43:02
%S 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,
%T 28,27,32,29,64,0,60,0,24,35,58,0,72,39,86,41,88,0,122,45,116,0,78,0,
%U 128,51,98,0,108,0,144,57,80,59,202,0,204,0,60,65,184,0,216,69,188
%N Sum of the positive differences of the prime pairs (p,q) such that n = p + q and p <= q.
%C From _Bernard Schott_, May 01 2021: (Start)
%C a(n) = 0 iff n is in A166081.
%C a(n) is odd iff n is A048974. (End)
%F a(n) = Sum_{i=1..floor(n/2)} c(i) * c(n-i) * (n-2*i), where c is the prime characteristic (A010051).
%e a(16) = 16; We have (3,13) and (5,11). The sum of the positive differences is (13-3) + (11-5) = 10 + 6 = 16.
%t Table[Sum[(n - 2 i) (PrimePi[i] - PrimePi[i - 1]) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[n/2]}], {n, 100}]
%o (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
%Y Cf. A048974, A166081.
%K nonn
%O 1,7
%A _Wesley Ivan Hurt_, Apr 29 2021