Here is my code, and pretty brute force. Seeking smarter solutions. I remember there are some theory in Number Theory to check whether a number is a prime number with high efficiency, but cannot find it out. Anyone have smarter ideas are appreciated.
def isPrimeNumber(self, num):
i = 2
while (i <= num / 2):
if num % i == 0:
return False
i = i + 1
return True
thanks in advance, Lin