121*. Find the condition for divisibility

$$
x^{n}+x^{n-1}+\ldots+x+1 \text { by } x^{p}+x^{p-1}+\ldots+x+1 \text {. }
$$

22
Instruction. The task is to transform the dividend and divisor into a form for which the question of divisibility can be solved using already discussed problems. Multiply the dividend and divisor by $(x-1)$, where $x \neq 1$. We get:

$$
\begin{aligned}
& \left(x^{n}+x^{n-1}+\ldots+x+1\right)(x-1)=x^{n+1}-1 \\
& \left(x^{p}+x^{p-1}+\ldots+x+1\right)(x-1)=x^{p+1}-1
\end{aligned}
$$

According to problem 115, $x^{n+1}-1$ will be divisible by $x^{p+1}-1$ when $n+1=$ $=k(p+1)$.