import math


def primality(n):
    """ Check the primality of an integer. Returns True or False. """
    
    if n < 2:
        return False

    if n < 4:
        return True

    if n % 2 == 0:
        return False

    if n % 3 == 0:
        return False

    root = math.sqrt(n)

    f = 5
    while f <= root:
        if n%f == 0:
            return False
        if n%(f+2) == 0:
            return False
        f += 6

    return True