login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers k such that the number of odd nonprimes <= k is equal to the number of primes <= k.
0

%I #9 Nov 07 2021 02:12:27

%S 2,93,94,97,98,101,102,105,106,117,118

%N Numbers k such that the number of odd nonprimes <= k is equal to the number of primes <= k.

%C This sequence is finite. For k > 118, there are always more odd nonprimes than primes <= k.

%C Numbers k such that A000720(k) = A033271(k). - _Michel Marcus_, Nov 06 2021

%e a(4) = 97 is a term because there are 25 odd nonprimes <= 97 and 25 primes <= 97.

%t Select[Range@1000,(k=#;Length@Select[Range@k,OddQ@#&&!PrimeQ@#&]==PrimePi@k)&]

%o (PARI) isok(k) = primepi(k) == #select(x->(!isprime(x) && (x%2)), [1..k]); \\ _Michel Marcus_, Nov 06 2021

%Y Cf. A000040, A014076, A000720, A033271.

%K nonn,fini,full

%O 1,1

%A _Giorgos Kalogeropoulos_, Nov 01 2021