|
Search: id:A097454
|
|
|
| A097454 |
|
(Number of nonprimes <= n) - (number of primes <= n). |
|
+0 2
|
|
| 1, 0, -1, 0, -1, 0, -1, 0, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 5, 6, 5, 6, 7, 8, 9, 10, 9, 10, 9, 10, 11, 12, 13, 14, 13, 14, 15, 16, 15, 16, 15, 16, 17, 18, 17, 18, 19, 20, 21, 22, 21, 22, 23, 24, 25, 26, 25, 26, 25, 26, 27, 28, 29, 30, 29, 30, 31, 32, 31, 32, 31, 32, 33, 34, 35, 36, 35, 36, 37, 38, 37, 38, 39, 40, 41, 42, 41, 42, 43, 44, 45
(list; graph; listen)
|
|
|
OFFSET
|
1,10
|
|
|
EXAMPLE
|
a(7)=-1 because there are 3 nonprimes <=7 (1,4 and 6) and 4 primes <=7 (2,3,5 and 7).
|
|
MAPLE
|
with(numtheory): seq(n-2*pi(n), n=1..93); - Emeric Deutsch (deutsch(AT)duke.poly.edu), Apr 01 2006
|
|
PROGRAM
|
(PARI) compsmprimes(n) = { for(x=1, n, y=composites(x) - pi(x); print1(y", ") ) } \The number of composite numbers less than or equal to n composites(n) = { local(c, x); c=0; for(x=1, n, if(!isprime(x), c++); ); return(c) } \pi(x) prime count function pi(n) = { local(c, x); c=0; forprime(x=1, n, c++); return(c) }
|
|
CROSSREFS
|
(Number of composites <= n) - (number of primes <= n) is A072731. a(n)=1+A072731(n).
Sequence in context: A069003 A087855 A083409 this_sequence A139803 A058746 A080916
Adjacent sequences: A097451 A097452 A097453 this_sequence A097455 A097456 A097457
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
Cino Hilliard (hillcino368(AT)gmail.com), Aug 23 2004
|
|
|
Search completed in 0.002 seconds
|