10.4. Let's consider all 7! seven-digit numbers obtained from the number 1234567 by all possible permutations of its digits. How many of them give a remainder of 5 when divided by 7? Answer: 6!.
Solution. Let $A_{n}, n=0,1, \ldots, 6$ be the sets of the considered numbers that give remainders $0,1,2, \ldots 6$ respectively when divided by 7. We will prove that each of these sets contains the same number of elements, equal to $7!/ 7=6!$. Note that the number 1111111 gives a remainder of 1 when divided by 7. With each of the considered numbers $a$, we will perform the following: add one to each digit of $a$, and if this results in the digit 8 in some place, replace it with the digit 1, which gives the same remainder when divided by 7. The remainder of the obtained number when divided by 7 is equal to the remainder of the number $a+1111111$ when divided by 7, which is one more than the remainder of the number $a$ when divided by 7. Therefore, this mapping uniquely translates each number from the set $A_{n}$ into some number from the set $A_{n+1}$, for all $n=0,1, \ldots, 6$, and different numbers from $A_{n}$ are translated into different numbers from $A_{n+1}$. Thus, the number of elements in $A_{1}$ is not less than in $A_{0}$, the number of elements in $A_{2}$ is not less than in $A_{1}$, and so on, ... the number of elements in $A_{0}$ is not less than in $A_{6}$, so all sets $A_{n}, n=0,1, \ldots, 6$ contain the same number of elements, equal to $7!/ 7=6!$.

Grading criteria. ($\cdot$) The idea of adding 1 in all places: 2 points. . ($\cdot$) Proof that such an operation translates the sets $A_{n}, n=0,1, \ldots, 6$ into each other: 3 points. . ( ) Proof of the equicardinality of these sets: 2 points.