My current algorithm to check the primality of numbers in python is way to slow for numbers between 10 million and 1 billion. I want it to be improved knowing that I will never
Well, I have a follow-up to my comment under (very good) Peter Van Der Heijden's answer about there being nothing good for really large primes (numbers in general) in the "popular" Python libraries. Turns out I was wrong - there is one in sympy
(great library for symbolic algebra, among others):
https://docs.sympy.org/latest/modules/ntheory.html#sympy.ntheory.primetest.isprime
Of course, it may yield false positives above 10**16
, but this is already much better than anything else I could get doing nothing (except maybe pip install sympy
;) )