22.4. (USA, 77). Find all pairs of numbers $m, n \in \mathbf{N}$, for which the polynomial $1+x^{n}+x^{2 n}+\ldots+x^{m n}$ is divisible by the polynomial $1+x+x^{2}+\ldots+x^{m}$.
22.4. The polynomials $P(x)=1+x+\ldots+x^{m}$ and $Q(x)=1+x^{n}+\ldots+x^{m n}$ do not have multiple roots, since the polynomials $x^{m+1}-1=(x-1) P(x)$ and $x^{n(n+1)}-1=\left(x^{n}-1\right) Q(x)$ do not have multiple roots. Therefore, according to Theorem 54, the polynomial $Q(x)$ is divisible by $P(x)$ if and only if every root of the polynomial $P(x)$ is a root of the polynomial $Q(x)$, or equivalently, if every root of the equation $x^{m+1}=1$ (which automatically satisfies the equation $x^{n(n+1)}=1$) is not a root of the equation $x^{n}=1$. Thus, all the required pairs (and only they) of numbers $m, n$ must be such that the system

$$
\left\{\begin{aligned}
x^{m+1} & =1 \\
x^{n} & =1
\end{aligned}\right.
$$

has the unique solution $x=1$. If $(m+1, n)=d>1$, then this system has one of its solutions the number $x=\cos (2 \pi / d)+i \sin (2 \pi / d) \neq 1$. If, however, $(m+1, n)=1$, then by Theorem 24 there exist integers $k$ and $l$ such that $k(m+1)+l n=1$, and thus for any solution $x$ of this system we have $x=x^{k(m+1)+l n}=\left(x^{m+1}\right)^{k}\left(x^{n}\right)^{l}=1$. Therefore, a pair of natural numbers $m, n$ satisfies the condition of the problem if and only if the numbers $m+1$ and $n$ are coprime.