login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051352 a(0) = 0; for n>0, a(n) = a(n-1) + n if n not prime else a(n-1) - n. 3
0, 1, -1, -4, 0, -5, 1, -6, 2, 11, 21, 10, 22, 9, 23, 38, 54, 37, 55, 36, 56, 77, 99, 76, 100, 125, 151, 178, 206, 177, 207, 176, 208, 241, 275, 310, 346, 309, 347, 386, 426, 385, 427, 384, 428, 473, 519, 472, 520, 569, 619, 670, 722, 669, 723, 778 (list; graph; refs; listen; history; internal format)
OFFSET

0,4

COMMENTS

Sequence is not monotonic.

a(n) = a(n-1)+n*(1-2*A010051(n)) = a(n-1)+n*(2*A0005171(n)-1) = a(n-1)+n*(A0005171(n)-A010051(n)). [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Nov 25 2009]

LINKS

William A. Tedeschi, Table of n, a(n) for n=0..10000

FORMULA

Difference between sum of composite numbers and prime numbers <= n. - Zak Seidov (zakseidov(AT)yahoo.com), Sep 27 2003

MATHEMATICA

a[0]=0; a[n_]:=a[n]=If[PrimeQ[n], a[n-1]-n, a[n-1]+n]; Table[a[i], {i, 0, 60}] (* From Harvey P. Dale, Apr 07 2011 *)

CROSSREFS

Sequence in context: A089389 A081550 A046779 * A195495 A003816 A083745

Adjacent sequences:  A051349 A051350 A051351 * A051353 A051354 A051355

KEYWORD

sign,easy,nice

AUTHOR

Armand Turpel armandt(AT)unforgettable.com

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 12:41 EST 2012. Contains 205909 sequences.