Problem 4. Determine all non-zero natural numbers $p$ for which there exists $n \in \mathbb{N}^{*}$ such that $p^{n}+3^{n}$ divides the number $p^{n+1}+3^{n+1}$.
Solution and grading: We have the equality $p^{n+1}+3^{n+1}=\left(p^{n}+3^{n}\right)(p+3)-3 p\left(p^{n-1}+3^{n-1}\right)$.

If $p^{n}+3^{n}$ divides the number $p^{n+1}+3^{n+1}$, then $p^{n}+3^{n}$ divides $3 p\left(p^{n-1}+3^{n-1}\right)$. If we assume that $p$ and 3 are coprime, then $p^{n}+3^{n}$ will be coprime with 3 and with $p$. We obtain that $p^{n}+3^{n}$ divides $p^{n-1}+3^{n-1}$, which is false because $p^{n}+3^{n}>p^{n-1}+3^{n-1}>0$. From here we get that $p$ is divisible by

![](https://cdn.mathpix.com/cropped/2024_06_07_8d1cc49a3c6af70227b2g-2.jpg?height=52&width=1832&top_left_y=1123&top_left_x=141)

Let $k \in \mathbb{N}^{*}$ such that $p=3 k$. Then $3^{n}\left(k^{n}+1\right) \mid 3 \cdot 3 k \cdot 3^{n-1}\left(k^{n-1}+1\right)$, from which we get that $k^{n}+1 \mid 3 k^{n}+3 k$, i.e., $k^{n}+1 \mid 3 k^{n}+3+3 k-3$. Then $k^{n}+1 \mid 3 k-3$. For $n \geq 2$, we have $k^{n}+1 \geq$ $k^{2}+1>3 k-3$, so it remains that $3 k-3=0$ or $n=1$.

The first case leads to $p=3$, and the property in the statement is valid for any $n \in \mathbb{N}^{*}$.

In the second case, from $k+1 \mid 3 k-3$ we get $k \in\{1,2,5\}$, so $p \in\{3,6,15\}$. 2p