Perfect numbers

Once, Beremiz explained to a sheikh what are perfect numbers: those whose sum of positive divisors, the number excluded, equals the number itself.

For instance, 6 is perfect, because all its positive divisors (except 6 itself) are 1, 2 and 3, and 1+2+3=61 + 2 + 3 = 6. Other perfect numbers are 28 and 496.

Input

Input consists of several natural numbers nn, all between 1 and 101210^{12}.

Output

For every nn, print the difference in absolute value between the sum of the divisors of nn (nn excluded), and nn. Note that we can interpret this difference as the “imperfection” of the number, which is 0 only for perfect numbers.

Observation

At the time of the creation of this problem (year 2013), only 48 perfect numbers are known, all even. The largest one has about 35 million digits. It is unknown whether there are infinitely many perfect numbers, or if any of them is odd.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T11:21:57.164Z

© Jutge.org, 2006–2026.
https://jutge.org