4. Find all eight-digit numbers $* 2 * 0 * 1 * 6$ with four unknown odd digits marked by asterisks, which are divisible by the number 2016.
SOLUTION. Since $2016=2^{5} \cdot 3^{2} \cdot 7$, we are looking for numbers $n=\overline{a 2 b 0 c 1 d 6}$ with odd digits $a, b, c$, and $d$, which are also divisible by the numbers $32=2^{5}, 9=3^{2}$, and 7.

The number $n=\overline{a 2 b 0 c 1 d 6}$ is divisible by 32 if and only if its last five digits

$$
\overline{0 c 1 d 6}=1000 c+100+10 d+6=32(31 c+3)+8(c+d+1)+2(d+1).
$$

According to divisibility by eight, we see that the number $d+1$ must be divisible by four, so it is either $d=3$ or $d=7$. In the case of $d=3$, our five-digit number is equal to $32(31 c+3)+8(c+5)$, so it is divisible by 32 if and only if the number $c+5$ is divisible by 4, i.e., $c \in\{3,7\}$. In the case of $d=7$, however, the five-digit number is equal to $32(31 c+3)+8(c+10)$, so it is not divisible by 32 because $c$ is an odd digit, and thus the number $c+10$ is odd, making the number $8(c+10)$ not divisible by 32. The condition of divisibility by 32 is therefore satisfied only by those $n$ which for the pair of odd digits $(c, d)$ have $(3,3)$ or $(7,3)$.

The number $n=\overline{a 2 b 0 c 1 d 6}$ is divisible by nine if and only if its digit sum

$$
a+2+b+0+c+1+d+6=a+b+c+d+9
$$

is divisible by 9. From this, we obtain the possible values of the sum $a+b$ for both already determined pairs $(c, d)$. We also take into account that the sum $a+b$ must be an even number because both digits $a$ and $b$ are odd. For the first pair $(c, d)=(3,3)$, we get $a+b=12$, i.e., $\{a, b\}=\{3,9\}$ or $\{5,7\}$. For the second pair $(c, d)=(7,3)$, we get $a+b=8$, i.e., $\{a, b\}=\{1,7\}$ or $\{a, b\}=\{3,5\}$. We conclude that only eight numbers of the required form are divisible by both 32 and 9. These are the numbers

$32903136, 92303136, 52703136, 72503136$,

$12707136, 72107136, 32507136, 52307136$.

The divisibility by the last factor 7 remains to be assessed only for these eight candidates for the solution of our problem. It is easy to verify that only the first and the last of the listed six numbers are divisible by seven. This can be done quickly by direct division (if we have a calculator at hand), or instead, we can use a less well-known criterion for divisibility by seven, according to which any eight-digit number

$\overline{a_{7} a_{6} a_{5} a_{4} a_{3} a_{2} a_{1} a_{0}}=a_{0}+a_{1} \cdot 10^{1}+a_{2} \cdot 10^{2}+a_{3} \cdot 10^{3}+a_{4} \cdot 10^{4}+a_{5} \cdot 10^{5}+a_{6} \cdot 10^{6}+a_{7} \cdot 10^{7}$

gives the same remainder when divided by seven as the sum

$$
s=a_{0}+3 a_{1}+2 a_{2}+6 a_{3}+4 a_{4}+5 a_{5}+a_{6}+3 a_{7}.
$$

(The coefficient of each digit $a_{k}$ is the remainder when the corresponding power $10^{k}$ is divided by seven.)

Answer. Only two numbers satisfy the condition: 32903136 and 52307136.

SUPPLEMENTARY AND ADDITIONAL PROBLEMS:

N1. Generalize the known criteria for divisibility by 2, 4, and 8 to a criterion for divisibility by $2^{k}$ for any natural number $k$: An integer written in decimal notation is divisible by $2^{k}$ if and only if its last $k$-digit number is. [The difference between the number and its last $k$-digit number is a number whose notation ends with $k$ zeros, so it is divisible by $10^{k}$, and thus also by $2^{k}$. This means that any number and its last $k$-digit number always give the same remainder when divided by $2^{k}$.]

N2. Recall the known fact that a given natural number and its digit sum give the same remainders when divided by three and nine. Does this hold for division by $3^{3}=27$? [No, for example, the number 27 is divisible by 27, but its digit sum $2+7=9$ is not divisible by 27. The reverse implication also does not hold: for example, the number 1899 with a digit sum of 27 is not divisible by this number.]

D1. Prove that the divisibility by seven of any number $N$ written in decimal notation can be decided using the "code" 132645 as follows: The six-digit number $N=\overline{a_{5} a_{4} a_{3} a_{2} a_{1} a_{0}}$ gives the same remainder when divided by seven as the sum

$$
s=1 a_{0}+3 a_{1}+2 a_{2}+6 a_{3}+4 a_{4}+5 a_{5}
$$

(we write the digits from the back and write the digits of the code as coefficients). If the number $N$ has fewer than six digits, we write the corresponding shorter sum; if the number $N$ has more than six digits, we repeat the code digits with a period of 6, i.e.,

$$
s=a_{0}+3 a_{1}+2 a_{2}+6 a_{3}+4 a_{4}+5 a_{5}+a_{6}+3 a_{7}+2 a_{8}+6 a_{9}+\ldots
$$

D2. Prove that for any integer $n$, the number obtained by writing $3^{n}$ ones in a row is a multiple of the number $3^{n}$. [Use mathematical induction: for $n=1$ (and also for $n=2$), the statement clearly holds (use the digit sum). In the second inductive step, note that the number with $3^{n+1}$ ones is a multiple of the number with $3^{n}$ ones, and the corresponding quotient is a number of the form $10 \ldots 010 \ldots 01$, i.e., a number divisible by three (it has a digit sum of 3).]