Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #46 Sep 08 2022 08:46:21
%S 1,-1,1,-3,-1,-5,-3,-7,-1,-3,3,-1,1,-3,3,-3,-1,-7,-3,-5,1,-3,3,-5,-1,
%T -3,1,-1,3,-11,-7,-13,-11,-21,-19,-25,-19,-23,-17,-23,-21,-31,-29,-33,
%U -31,-43,-31,-35,-33,-37,-31,-33,-23,-29,-23,-29,-27,-33,-29,-31
%N Alternating partial sums of the prime gaps.
%C Does this sequence change sign infinitely often?
%H Rémy Sigrist, <a href="/A308655/b308655.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = Sum_{k=1..n} ((-1)^(k+1))*(prime(k+1) - prime(k)).
%t Table[Sum[((-1)^(k + 1)) (Prime[k + 1] - Prime[k]), {k, 1, n}], {n, 70}] (* _Vincenzo Librandi_, Jul 02 2019 *)
%o (PARI) a(n) = sum(k=1, n, ((-1)^(k+1))*(prime(k+1) - prime(k))); \\ _Michel Marcus_, Jun 14 2019
%o (Magma) [&+[((-1)^(k+1))*(NthPrime(k+1)-NthPrime(k)): k in [1..n]]: n in [1..100]]; // _Vincenzo Librandi_, Jul 02 2019
%Y Cf. A000040, A001223 (prime gaps), A274828.
%K sign
%O 1,4
%A _Marc Morgenegg_, Jun 14 2019
%E More terms from _Michel Marcus_, Jun 14 2019