

A033271


Number of odd nonprimes <= n.


0



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

Table of n, a(n) for n=1..80.


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
Adjacent sequences: A033268 A033269 A033270 * A033272 A033273 A033274


KEYWORD

nonn


AUTHOR

N. J. A. Sloane


EXTENSIONS

More terms from Stefan Steinerberger, May 09 2006


STATUS

approved



