Could not understand the approach

I am not able to get the concept of factorization by this method if we already have to calculate the prime sieve which takes o(nloglogn) time and then do this won’t it take much longer. I found a few videos on youtube to find the smallest prime factors in such a case but could not understand them I would be grateful if you could provide me with some good resources about this topic
thank you

you can read about factorization from here
they explained it in detail

https://cp-algorithms.com/algebra/factorization.html

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.