How to find prime numbers?
this is very important
Check out the function isPrime in this code: https://code.sololearn.com/cJ1rV8PUIzC3/?ref=app
Like this up to n<4759123141 DeterministiccMiller-Rabin test - for low Ns only 3 tests are needed. You cant be faster. https://code.sololearn.com/cZo7y4VVqSJJ/?ref=app
Also look at this one to find prime factors https://code.sololearn.com/cU9K9ia897vz/?ref=app