import math


def prime(n):
    """Checks if n is prime. Returns True if it is, False if not."""
    s = int(math.ceil(math.sqrt(n)))
    if n > 3:
        for i in range(2, s+1):
            if (n % i == 0):
                return False
    return True