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 = 6. Other perfect numbers are 28
and 496.

Input

Input consists of several natural numbers n, all between 1 and 10¹².

Output

For every n, print the difference in absolute value between the sum of
the divisors of n (n excluded), and n. 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
