## Task B-1.6.

How many ordered pairs of natural numbers $(m, n)$ are there for which the number $3^{m}+7^{n}$ is divisible by 10, given that $1 \leqslant m \leqslant 80, 81 \leqslant n \leqslant 185$?
## Solution.

A number is divisible by 10 if and only if its last digit is 0. To determine the last digit of the sum of powers $3^{m}+7^{n}$, we will consider the last digit of the power $3^{m}$, and $7^{n}$.

The last digit of the power $3^{m}$ can be $3,9,7$ or 1 and repeats cyclically in this order. Thus, if the exponent $m$ when divided by 4 leaves a remainder of 1, the last digit of the power $3^{m}$ is 3. If the remainder is 2, the last digit is 9. If the remainder is 3, the last digit is 7, and if $m$ is divisible by 4, the last digit is 1.

Among all numbers $m, 1 \leqslant m \leqslant 80$, there are exactly:

$\frac{77-1}{4}+1=20$ of them which when divided by 4 leave a remainder of $1: 1,5, \ldots, 77$,

20 which leave a remainder of $2: 2,6, \ldots, 78$,

20 which leave a remainder of 3: $3,7, \ldots, 79$ and

20 which are divisible by 4.

2 points

Similarly to the previous considerations, the last digit of the power $7^{n}$ is 7 if the exponent $n$ when divided by 4 leaves a remainder of 1, 9 if the remainder is 2, 3 if the remainder is 3, and 1 if $n$ is divisible by 4.

Among all numbers $n, 81 \leqslant n \leqslant 185$, there are exactly:

$\frac{185-81}{4}+1=27$ of them which when divided by 4 leave a remainder of 1: $81,85, \ldots, 181,185$,

26 which leave a remainder of $2: 82,86, \ldots, 182$,

26 which leave a remainder of 3: 83, 87, ..., 183 and

26 which are divisible by $4: 84,88, \ldots, 180,184$.

2 points

The desired sum $3^{m}+7^{n}$ will have the last digit 0, i.e., be divisible by 10 in one of the following four cases:

- The power $3^{m}$ has the last digit 3 and the power $7^{n}$ has the last digit 7. According to the previous considerations, there are 20 possibilities for choosing the number $m$ and 27 possibilities for choosing the number $n$, so in this case, there are a total of $20 \cdot 27=540$ ordered pairs $(m, n)$.
- The power $3^{m}$ has the last digit 9 and the power $7^{n}$ has the last digit 1. There are a total of $20 \cdot 26=520$ such pairs $(m, n)$.
- The power $3^{m}$ has the last digit 7 and the power $7^{n}$ has the last digit 3. There are a total of $20 \cdot 26=520$ such pairs $(m, n)$.
- The power $3^{m}$ has the last digit 1 and the power $7^{n}$ has the last digit 9. There are a total of $20 \cdot 26=520$ such pairs $(m, n)$.

Finally, the total number of the desired ordered pairs is

$20 \cdot 27+3 \cdot 20 \cdot 26=540+3 \cdot 520=2100$.

Note: The student does not have to list the numbers $m$ and $n$ which when divided by 4 leave a remainder of $0,1,2$ or 3. It is sufficient to count them.