login
A163294
a(n) = 2 + Sum_{x=n..prime(n)} (-x*(-1)^x).
1
1, 3, 6, 4, 10, 6, 14, 8, 18, 12, 23, 15, 29, 17, 33, 21, 40, 24, 45, 28, 49, 31, 55, 35, 63, 40, 67, 42, 71, 44, 81, 52, 87, 55, 94, 60, 99, 65, 105, 69, 112, 72, 119, 77, 123, 79, 131, 90, 140, 92, 144, 96, 149, 101, 158, 106, 165, 109, 170, 113, 174, 118, 187, 126, 191
OFFSET
1,2
LINKS
EXAMPLE
a(1) = 2 + 1 - 2 = 1;
a(2) = 2 - 2 + 3 = 3;
a(3) = 2 + 3 - 4 + 5 = 6;
a(4) = 2 - 4 + 5 - 6 + 7 = 4;
a(5) = 2 + 5 - 6 + 7 - 8 + 9 - 10 + 11 = 10.
MAPLE
A163294 := proc(n) 2+add( -j*(-1)^j, j=n..ithprime(n)) ; end: seq(A163294(n), n=1..120) ; # R. J. Mathar, Oct 10 2009
MATHEMATICA
Table[2 + Sum[k*(-1)^(k + 1), {k, n, Prime[n]}], {n, 1, 100}] (* G. C. Greubel, Dec 17 2016 *)
PROG
(PARI) for(n=1, 50, print1(2 + sum(k=n, prime(n), k*(-1)^(k+1)), ", ")) \\ G. C. Greubel, Dec 17 2016
CROSSREFS
Sequence in context: A242224 A294671 A275985 * A168577 A122634 A169846
KEYWORD
nonn,less
AUTHOR
EXTENSIONS
Corrected by Juri-Stepan Gerasimov, Jul 26 2009
Edited (but not checked) by N. J. A. Sloane, Jul 27 2009
Roughly 50 percent of the entries corrected by R. J. Mathar, Oct 10 2009
STATUS
approved