5. The computer generated several different natural numbers. For each pair of numbers, it determined the highest power of 2022 by which their difference is divisible. The option that the difference is only divisible by the zeroth power is also possible. It turned out that the computer got 2023 different answers. What is the maximum number of numbers the computer could have generated
Solution.

Example. One of the possible sets is all numbers from 1 to $2022^{2023}$. The difference of any of them is divisible by 2022 no more than to the power of 2022, while all powers from 0 to 2022 are present.

Estimation. We will prove that it is impossible to select a larger number of numbers. Let's represent each number $a$ as an expansion in powers of 2022

$a=a_{2023} \cdot 2022^{2023}+a_{2022} \cdot 2022^{2022}+a_{2021} \cdot 2022^{2021}+\ldots+a_{k} \cdot 2022^{k}+\ldots+a_{1} \cdot 2022+a_{0}$

Here each coefficient $a_{k}$ changes from 0 to 2022 ( $k \leq 2022$ ). (If we consider the example written above, then $a_{2023}-0$ or 1 with all other $a_{k}=0$.) Let's write another number $b$

$b=b_{2023} \cdot 2022^{2023}+b_{2022} \cdot 2022^{2022}+b_{2021} \cdot 2022^{2021}+\ldots+b_{k} \cdot 2022^{k}+\ldots+b_{1} \cdot 2022+b_{0}$

The difference of these numbers is divisible by $2022^{p}$ if and only if $p$ is the smallest digit in which the numbers $a$ and $b$ differ. That is, if $a_{p-1}=b_{p-1}, a_{p-2}=b_{p-2}, \ldots a_{1}=$ $b_{1}, a_{0}=b_{0}, a_{p} \neq b_{p}$, then the difference $a-b$ is divisible by $2022^{p}$.

Suppose that more than $2022^{2023}$ numbers $a$, represented in the specified form, have been generated. Assume even that there are terms with powers greater than 2023. Choose 2023 terms corresponding to all 2023 powers by which the difference is divisible (according to the condition). The number of different numbers that differ in the coefficients $a_{k}$ in these terms is $2022^{2023}$ (2022 for each $k$). Since the number of generated numbers is greater than $2022^{2023}$, there will be two numbers that have the same coefficients $a_{k}$ in all selected terms. In this case, we will get another power of the number 2022 that enters the set of divisibility powers. That is, we get more than 2023 powers, which contradicts the condition.