login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
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
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 * A356365 A217663 A078701
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 14:58 EDT 2024. Contains 371780 sequences. (Running on oeis4.)