OFFSET
1,1
COMMENTS
s(k) starts +1, -1, -1, +1, +1, -1, -1, ...
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..2000
EXAMPLE
a(6) = +2 - 3 - 5 + 7 + 11 - 13 = -1.
MATHEMATICA
f[n_] := Sum[(-1)^Floor[k/2]*Prime[k], {k, n}]; Array[f, 60] (* Robert G. Wilson v, Aug 06 2017 *)
PROG
(PARI)
s(k) = (-1)^(floor(k/2));
a(n) = sum(k=1, n, s(k)*prime(k));
\\ Joerg Arndt, Aug 06 2017
(Magma) [&+[NthPrime(k)*(-1)^(Floor(k/2)): k in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Aug 07 2017
CROSSREFS
KEYWORD
sign,easy,less
AUTHOR
Jon Perry, Dec 16 2013
EXTENSIONS
Name corrected by Joerg Arndt, Aug 06 2017
STATUS
approved