## Task A-2.3.

A natural number is called pretty if when added to one of its divisors, the result is 360. Determine the sum of all pretty numbers.
## Solution.

First, let's prove the following statement: a natural number $n$ is pretty if and only if it is of the form $360-d$, where $d$ is a divisor of 360 less than 360.

First, let $n$ be pretty. Then there exists a divisor $d$ of $n$ such that $n+d=360$. Since $d$ divides $n$ and itself, it divides the left side of the equation, and thus it divides the right side as well. Therefore, $n$ can indeed be written as $360-d$, where $d$ is a divisor of 360. Clearly, $d<360$, otherwise $n$ would not be a natural number.

Now, assume that $n$ can be written as $360 - d$, where $d$ is a divisor of 360 less than that number. Then from the equation $n=360-d$, similarly as before, we see that $d$ divides the expressions on the right side, so it must divide the expression on the left side as well. Therefore, $d$ is a divisor of $n$, and $n+d=360$, making $n$ a pretty number.

Since every pretty number is the difference between 360 and a divisor of 360, we conclude that

$$
360-d_{1}, 360-d_{2}, \ldots, 360-d_{N}
$$

are all pretty numbers, where $d_{1}, d_{2}, \ldots, d_{N}$ are all divisors of 360 less than 360 itself.

Therefore, the desired sum can be written as

$$
I:=\left(360-d_{1}\right)+\cdots+\left(360-d_{N}\right)=360 \cdot N-\left(d_{1}+\cdots+d_{N}\right)=360 \cdot N-S
$$

where $N$ and $S$ are the number and the sum of divisors of 360 less than 360.

In general, for a natural number $n$ with a unique prime factorization in the form

$$
n=p_{1}^{\alpha_{1}} \cdot \ldots \cdot p_{k}^{\alpha_{k}}
$$

the formulas for the number of divisors $\tau(n)$ and the sum of divisors $\sigma(n)$ (including $n$ itself as a divisor) are respectively:

$$
\begin{aligned}
\tau(n) & =\left(\alpha_{1}+1\right) \cdot \ldots \cdot\left(\alpha_{k}+1\right) \\
\sigma(n) & =\frac{p_{1}^{\alpha_{1}+1}-1}{p_{1}-1} \cdot \ldots \cdot \frac{p_{k}^{\alpha_{k}+1}-1}{p_{k}-1}
\end{aligned}
$$

Applying these formulas, we get

$$
\begin{aligned}
\tau(360) & =(3+1)(2+1)(1+1)=24 \\
\sigma(360) & =\frac{2^{4}-1}{2-1} \cdot \frac{3^{3}-1}{3-1} \cdot \frac{5^{2}-1}{5-1}=1170
\end{aligned}
$$

so $N=24-1=23$, and $S=1170-360=810$.

Therefore, the final result is

$$
I=360 \cdot N-S=23 \cdot 360-810=7470
$$

1 point

Note: The number $N$ and the sum $S$ of the divisors of 360 can also be determined by directly listing all divisors. Listing all 23 divisors of 360 less than 360 earns 2 points, and their summation earns 1 point.