Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A118777
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A118777 a(0) = 1; n > 0: a(n) = a(n-1) + d, d = -/+1 if n is prime/composite. +0
1
1, 2, 1, 0, 1, 0, 1, 0, 1, 2, 3, 2, 3, 2, 3, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 10, 11, 10, 11, 10, 11, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 22, 23, 22, 23, 24, 25, 26, 27, 26, 27, 26, 27, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 32, 33, 34, 35, 36 (list; graph; listen)
OFFSET

1,2

FORMULA

a(n)=n + 1 - 2*primepi(n), n=0,1,2,...

MATHEMATICA

(*1*) a=1; s={a}; Do[b=a+If[PrimeQ[n], -1, 1]; AppendTo[s, b]; a=b, {n, 100}]; s

(*2*) Table[n + 1 - 2*PrimePi[n], {n, 0, 100}]

CROSSREFS

Sequence in context: A085004 A095774 A071993 this_sequence A073068 A166006 A116683

Adjacent sequences: A118774 A118775 A118776 this_sequence A118778 A118779 A118780

KEYWORD

nonn

AUTHOR

Zak Seidov, May 22 2006

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 27 14:50 EST 2009. Contains 167570 sequences.


AT&T Labs Research