
1. Let $n$ be the sum of all ten-digit numbers, which contain every decimal digit from zero to nine. Determine the remainder of $n$ when divided by 77 .

(Pavel Novotný)


Solution. We determine the value of $n$ first. We count for each non-zero digit the number of its occurrences in the summands (giving $n$ altogether) in the place of units, tens, hundreds, ... This enables us to evaluate the "contribution" of each digit to the sum, and thus $n$ itself. Every digit is on each of the places $9 !-8$ ! times (we have to subtract the "numbers" starting with zero) except for the first place, where it is 9 ! times (we do not have to subtract anything). In total we get

$$
\begin{aligned}
n & =(1+2+\cdots+9)(9 !-8 !)\left(10^{8}+10^{7}+\cdots+10+1\right)+(1+2+\cdots+9) \cdot 9 ! \cdot 10^{9} \\
& =45\left(8 \cdot 8 ! \cdot 111111111+9 \cdot 8 ! \cdot 10^{9}\right)=45 \cdot 8 ! \cdot 9888888888 .
\end{aligned}
$$

Thus $n$ is divisible by 7 and by the criterion of divisibility by 11 is

$$
9888888888 \equiv 8-8+8-8+\cdots+8-9 \equiv-1 \quad(\bmod 11)
$$

Further $8 ! \equiv 5(\bmod 11)$. In total

$$
n \equiv 45 \cdot 8 ! \cdot 9888888888 \equiv 1 \cdot 5 \cdot 10 \equiv 6 \quad(\bmod 11) .
$$

Finally $n \equiv 28(\bmod 77)$.
