def smallest_prime_factor(x):
    """ Return smallest prime number that is a divisor of x"""
    # start checking with 2, then move up one by one
    n = 2
    while n <=  x:
        if x % n == 0:
            return n
        n += 1