4. Find all prime numbers p and q and natural numbers n for which p is a divisor of q-1 and q ${ }^{\mathrm{n}}$ is a divisor of $\mathrm{p}^{2}-1$.
Solution. Let $p \mid q-1$ and $q^{n} \mid p^{2}-1$. Then $p \leq q-1$ and $q^{n} \leq p^{2}-1$, from which $\mathrm{q}^{\mathrm{n}} \leq \mathrm{p}^{2}-1 \leq(\mathrm{q}-1)^{2}-1=\mathrm{q}^{2}-2 \mathrm{q}$. The inequality $\mathrm{q}^{\mathrm{n}} \leq \mathrm{q}^{2}-2 \mathrm{q}$ does not hold for $n \geq 2$. Therefore, $n=1$, i.e., $q \mid(p-1)(p+1)$. If $q \mid p-1$ then $q \leq p-1 \leq q-2$, which is impossible. Then $\mathrm{q} \mid \mathrm{p}+1$, and from $\mathrm{q} \leq \mathrm{p}+1 \leq \mathrm{q}$ it follows that $\mathrm{q}=\mathrm{p}+1$. The last equality holds only for $\mathrm{p}=2$ and $\mathrm{q}=3$. Therefore, the only solution is $n=1, p=2, q=3$.