def is_prime(n):
    """
    Checks if n is a prime number
    Returns: boolean (True if n is prime, False otherwise)
    """
    if n < 2:
        return False
    # the first prime number
    if n == 2:
        return True
    # all even numbers, except 2, are not prime numbers
    if n % 2 == 0:
        return False
    # primality test
    for x in range(3, int(n ** 0.5) + 1, 2):
        # dividing n for all numbers in range [3, sqrt(n) + 1]
        if n % x == 0:
            # n is divisible by x, so n is not a prime
            return False
    # if we get here, then n is a prime
    return True