def is_prime_det(n):
    """
    Returns <True> if <n> is a prime number, returns <False> otherwise. It
    uses an (optimized) deterministic method to guarantee that the result
    will be 100% correct.
    """
    # 2 and 3 are prime numbers
    if (n <= 3):
        return (n > 1)

    # Corner cases to speed up the next loop
    if (n % 2 == 0) or (n % 3 == 0):
        return False

    # Using (6k-1) and (6k+1) optimization
    i = 5
    while (i * i <= n):
        if (n % i == 0) or (n % (i + 2) == 0):      # Not a prime number
            return False
        i += 6

    return True