My mission is to calculate the factorization of large numbers, for example, from $start=1e11$ to $end=1e12$.
To do that, one approach that I was thinking of is to calculate for each number his factorization by dividing prime numbers from it, assuming I have a large data set of prime numbers. This will take roughly $O(log\left(n\right))$ for each number or $O(\frac{n}{log\left(n\right)})$ by $PNT$ theorem (If the number is prime), but it takes too long.
A different approach that I was thinking of is to use some kind of combinatorics argument like this thread: Number of possible products
If I have a large data set of prime numbers, I can calculate all the possible products from the set and check if it fits into the range, attacking the problem in a more global manner instead of individually, but I don't know how to exactly implement it.
My question is, what is the right approach? And how can I implement it in my calculation?