OFFSET
1,21
COMMENTS
A346622 is a different although very similar sequence. - N. J. A. Sloane, Aug 23 2021
EXAMPLE
a(33)= 3. The semiprimes <=33 are 15, 21 and 33. Formula gives 11-pi(5)-pi(16)+1 = 3.
MATHEMATICA
Accumulate[Table[If[OddQ[n]&&SquareFreeQ[n]&&PrimeOmega[n]==2, 1, 0], {n, 0, 100}]] (* Harvey P. Dale, Feb 08 2016 *)
PROG
(Python)
from math import isqrt
from sympy import prime, primepi
def A146167(n): return int(sum(primepi(n//prime(k))-k+1 for k in range(2, primepi(isqrt(n))+1)))-primepi(isqrt(n))+1 if n>3 else 0 # Chai Wah Wu, Jul 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Washington Bomfim, Oct 27 2008
STATUS
approved