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
def isprime(num): if (num==3)or(num==2): return(True) elif (num%2 == 0)or(num%5 == 0): return (False) elif ((((num+1)%6 ==0) or ((num-1)%6 ==0)) and (num>1)): return (True) else: return (False)
I think this code is the fastest ..