def is_power(a, b):
    """ This functions check if the number a is a power of b.
    That is, if the following is true for a certain number n: a == b**n.
    """

    if (a == 1):
        return True
    elif (a == b):
        return True
    elif (a == 0) and (b != 0):
        return False
    elif (a != 1) and (b == 1):
        return False
    else:
        if (a % b == 0) and is_power((a/b), b):
            return True
        else:
            return False