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

%I #13 Jan 16 2019 15:02:28

%S 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,

%T 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,

%U 14,14,15,15,16,16,16,16,17,17,17,17,17,17,18,18,19,19,19,19

%N Number of odd nonprimes <= n.

%F 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

%t Insert[Table[Floor[(n + 1)/2] - PrimePi[n] + 1, {n, 2, 80}], 1, 1] (* _Stefan Steinerberger_, May 09 2006 *)

%t 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 *)

%t Accumulate[Table[If[OddQ[n]&&!PrimeQ[n],1,0],{n,100}]] (* _Harvey P. Dale_, Jan 16 2019 *)

%K nonn

%O 1,9

%A _N. J. A. Sloane_

%E More terms from _Stefan Steinerberger_, May 09 2006

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 24 14:09 EDT 2024. Contains 371960 sequences. (Running on oeis4.)