import math
def isprime(x):
    if x ==2:
        return True
    if x<2 or x%2 ==0:
        return False
    else:
        sx = int(math.sqrt(x))
        a = 0
        for i in range(3,sx+1,2):
            if x%i ==0:
                return False
            
        return True
