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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066033 Alternating sum of primes: a(1) = A000040(1) = 2 and a(n) = a(n-1) + A000040(n)*(-1)^n for n > 1. 5
2, 5, 0, 7, -4, 9, -8, 11, -12, 17, -14, 23, -18, 25, -22, 31, -28, 33, -34, 37, -36, 43, -40, 49, -48, 53, -50, 57, -52, 61, -66, 65, -72, 67, -82, 69, -88, 75, -92, 81, -98, 83, -108, 85, -112, 87, -124, 99, -128, 101, -132, 107, -134, 117, -140, 123, -146, 125, -152, 129, -154, 139, -168, 143, -170, 147, -184, 153 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Harry J. Smith, Table of n, a(n) for n=1..1000

FORMULA

a(n) = 4 + (-1)^n*A008347(n). - Robert Israel, Jun 14 2016

MAPLE

ListTools:-PartialSums([2, seq((-1)^n*ithprime(n), n=2..100)]); # Robert Israel, Jun 14 2016

MATHEMATICA

4 + [Accumulate[Table[Prime[n](-1)^(n), {n, 1, 70}]] (* Terry D. Grant, Jun 14 2016 *)

PROG

(PARI) { for (n=1, 1000, if (n==1, a=2, a+=prime(n)*(-1)^n); write("b066033.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 07 2009

CROSSREFS

Cf. A007504, A008347, A000040.

Sequence in context: A019727 A011184 A157214 * A096319 A146105 A331165

Adjacent sequences:  A066030 A066031 A066032 * A066034 A066035 A066036

KEYWORD

sign

AUTHOR

Reinhard Zumkeller, Dec 12 2001

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 3 15:47 EST 2021. Contains 349464 sequences. (Running on oeis4.)