Amicable numbers generator on prolog