OFFSET
1,4
COMMENTS
Does this sequence change sign infinitely often?
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..n} ((-1)^(k+1))*(prime(k+1) - prime(k)).
MATHEMATICA
Table[Sum[((-1)^(k + 1)) (Prime[k + 1] - Prime[k]), {k, 1, n}], {n, 70}] (* Vincenzo Librandi, Jul 02 2019 *)
PROG
(PARI) a(n) = sum(k=1, n, ((-1)^(k+1))*(prime(k+1) - prime(k))); \\ Michel Marcus, Jun 14 2019
(Magma) [&+[((-1)^(k+1))*(NthPrime(k+1)-NthPrime(k)): k in [1..n]]: n in [1..100]]; // Vincenzo Librandi, Jul 02 2019
CROSSREFS
KEYWORD
sign
AUTHOR
Marc Morgenegg, Jun 14 2019
EXTENSIONS
More terms from Michel Marcus, Jun 14 2019
STATUS
approved