} 3\end{array}$ [ Decimal numeral system ]

a) Find the sum of all three-digit numbers that can be written using the digits 1, 2, 3, 4 (digits may repeat).

b) Find the sum of all seven-digit numbers that can be obtained by all possible permutations of the digits 1, ..., 7.
a) On each place, each of the digits appears $4^{2}=16$ times.

## Solution

b) First, let's find the sum of the digits in the units place. Each digit from 1 to 7 appears (as a units digit) in 6! numbers, so this sum is

$6! \cdot (1+2+\ldots+7) = 28 \cdot 6!$. The same is true for the other places.

## Answer

a) $16 \cdot (1+2+3+4) \cdot 111 = 17760$
b) $28 \cdot 6! \cdot 1111111$.

\section*{[Tables and Tournaments (Miscellaneous).]

![](https://cdn.mathpix.com/cropped/2024_05_06_43e7ff204cbd87ef9854g-01.jpg?height=94&width=1009&top_left_y=1342&top_left_x=16)

In an $8 \times 8$ table, one cell is colored black, and all others are white. Prove that it is impossible to make all cells white by recoloring rows and columns. By recoloring a row or column, we mean changing the color of all cells in that row or column.

## Solution

When recoloring a row or column, the parity of the number of black cells in the table does not change, and initially, their number is odd.

## [ Parity of Permutations  Problem 30778 Topics: [Decomposition into a product of transpositions and cycles $]$  Difficulty: 3  [ Parity and oddness $\quad]$  Classes: $7,8,9$

The numbers $1,2,3, \ldots, n$ are written in a row. In one move, it is allowed to swap any two numbers. Can the order of the numbers be the same as the initial order after 1989 such operations?

## Solution

Each pair ( $a, b$ ) of numbers can be in two states: correct, where the smaller number is to the left, and incorrect, where the smaller number is to the right. If there are exactly $k$ numbers between $a$ and $b$, and we swap $a$ and $b$, then exactly $2k+1$ pairs will change their state: the pair ( $a, b$ ) itself and all pairs containing one of the numbers $a, b$ and one of the $k$ intermediate numbers. Therefore, each operation changes the parity of the number of incorrect pairs.

Initially, all pairs were correct. Thus, after 1989 operations, the number of incorrect pairs will become odd. Therefore, the resulting sequence of numbers will not match the initial one.

## Answer

No, it cannot.

[ Numerical Inequalities. Comparing Numbers. $]$ Problem