login
A233809
a(n) = Sum_{k=1..n} prime(k) * s(k), where s(k) = (-1)^(floor(k/2)).
1
2, -1, -6, 1, 12, -1, -18, 1, 24, -5, -36, 1, 42, -1, -48, 5, 64, 3, -64, 7, 80, 1, -82, 7, 104, 3, -100, 7, 116, 3, -124, 7, 144, 5, -144, 7, 164, 1, -166, 7, 186, 5, -186, 7, 204, 5, -206, 17, 244, 15, -218, 21, 262, 11, -246, 17, 286, 15, -262
OFFSET
1,1
COMMENTS
s(k) starts +1, -1, -1, +1, +1, -1, -1, ...
LINKS
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
Cf. A130642 (a(n) = -1), A130643 (a(n) = 1). - Michel Marcus, Aug 06 2017
Sequence in context: A267354 A139625 A053785 * A207536 A060173 A059344
KEYWORD
sign,easy,less
AUTHOR
Jon Perry, Dec 16 2013
EXTENSIONS
Name corrected by Joerg Arndt, Aug 06 2017
STATUS
approved