The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A308655 Alternating partial sums of the prime gaps. 1
 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, -3, 1, -1, 3, -11, -7, -13, -11, -21, -19, -25, -19, -23, -17, -23, -21, -31, -29, -33, -31, -43, -31, -35, -33, -37, -31, -33, -23, -29, -23, -29, -27, -33, -29, -31 (list; graph; refs; listen; history; text; internal format)
 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 Cf. A000040, A001223 (prime gaps), A274828. Sequence in context: A099549 A334212 A082725 * A217663 A078701 A299766 Adjacent sequences:  A308652 A308653 A308654 * A308656 A308657 A308658 KEYWORD sign AUTHOR Marc Morgenegg, Jun 14 2019 EXTENSIONS More terms from Michel Marcus, Jun 14 2019 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 4 18:20 EDT 2020. Contains 334828 sequences. (Running on oeis4.)