Given a number $N$, how many numbers less than $N$ can be written as a product of less than $k$ prime factors?

412 Views Asked by At

So if I have some upper limit $N$, I am looking for the cardinality of the set of numbers with less than $k$, not necessarily distinct, prime factors.

It can be assumed that I have a list of all the primes less than $N$, and that I also have the power of Python in case it cannot be directly calculated.