Esempio n. 1
0
bool isAmicable(int x) {
    int sum = sumOfProperDivisors(x);
    return x != sum && x == sumOfProperDivisors(sum);
}
Esempio n. 2
0
bool Problem021::isAmicable(int a) {
    int ans = sumOfProperDivisors(a);
    return sumOfProperDivisors(ans) == a && ans != a;
}