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.