def iscarmichael(*args):
    """
    iscarmichael(*args). args are prime factors.
    Naively tests if the product of the given factors
    is a Carmichael number
    """
    for arg in args:
        if not is_prime(arg):
            return False
    xm1=reduce(lambda a,b : a*b, args)-1
    for arg in args:
        if xm1%(arg-1)!=0:
            return False
    return True

    iscarmichael(*args). args are prime factors.
    Naively tests if the product of the given factors
    is a Carmichael number
    
recipes/Python/576902_Mr/recipe-576902.py