login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033271 Number of odd nonprimes <= n. 1
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
LINKS
FORMULA
If n>1, then a(n) = floor((n+1)/2) - primepi(n) + 1, where primepi denotes the number of primes <= n a(n)/n is convergent against 0.5. - Stefan Steinerberger, May 09 2006
MATHEMATICA
Insert[Table[Floor[(n + 1)/2] - PrimePi[n] + 1, {n, 2, 80}], 1, 1] (* Stefan Steinerberger, May 09 2006 *)
nn=101; With[{nps=Complement[Range[1, nn, 2], Prime[Range[PrimePi[nn]]]]}, Table[Count[nps, _?(#<=n&)], {n, nn}]] (* Harvey P. Dale, Mar 23 2011 *)
Accumulate[Table[If[OddQ[n]&&!PrimeQ[n], 1, 0], {n, 100}]] (* Harvey P. Dale, Jan 16 2019 *)
CROSSREFS
Sequence in context: A194699 A262694 A137588 * A290792 A279757 A251550
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Stefan Steinerberger, May 09 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:56 EDT 2024. Contains 371964 sequences. (Running on oeis4.)