## Task A-4.7.

Determine all ordered triples $(x, y, p)$ where $p$ is prime, and $x$ and $y$ are natural numbers such that

$$
p^{x}-1=y^{3}
$$
## Solution.

When we move 1 to the right side and factor it, we get

$$
p^{x}=(y+1)\left(y^{2}-y+1\right)
$$

We conclude that the above equality is satisfied if each of the expressions $y+1$ and $y^{2}-y+1$ is a power of the number $p$, that is, there exist $a, b \in \mathbb{N}_{0}$ such that

$$
y+1=p^{a} \quad \text { and } \quad y^{2}-y+1=p^{b}
$$

If we substitute $y=p^{a}-1$ into the second equation, after rearranging we get

$$
p^{2 a}-3 p^{a}+3=p^{b}
$$

All expressions in the above equation except the number 3 are divisible by the smaller of the numbers $p^{a}, p^{b}$, so 3 must also be divisible by that number.

This is only possible if the smaller of the numbers $a$ and $b$ is equal to 0 or 1, which leads to 4 cases.

In the first case, let $a=0$. Then from the previous equation $y=p^{a}-1=1-1=0$, which is not a natural number, so we have not obtained a solution to the original equation.

In the second case, let $b=0$. Then from the equation $y^{2}-y+1=p^{b}$ we get $y(y-1)=0$, whose only solution in natural numbers is $y=1$. Then $p^{a}=y+1=2=2^{1}$. Upon verification, we get one solution to the original equation: $(x, y, p)=(1,1,2)$.

In the third case, let $a=1$ (and $b \geqslant a$). Then from the equation $p^{2 a}-3 p^{a}+3=p^{b}$ we see that $p^{a} \mid 3$, so $p=3$. Then $y=p^{a}-1=2$, from which, upon verification, we get an additional solution to the original equation: $(x, y, p)=(2,2,3)$.

In the last case, we have $b=1$ (and $a \geqslant b$). In the same way, we prove that $p=3$, from which we have $y^{2}-y+1=p^{b}=3$. The only natural solution to this equation is $y=2$, which leads to the already found solution $(x, y, p)=(2,2,3)$.

Therefore, all ordered triples $(x, y, p)$ that satisfy the conditions of the problem are equal to

$$
(1,1,2) \quad \text { and } \quad(2,2,3)
$$

Note: The division into four cases in the above solution can also be achieved by finding the greatest common divisor using the Euclidean algorithm on the numbers

$$
y+1=p^{a} \quad \text { and } \quad y^{2}-y+1=p^{b}
$$

Applying the Euclidean algorithm earns 1 point, and the conclusion that this divisor is equal to 1 or 3, and that the smaller of the numbers $y+1, y^{2}-y+1$ is equal to 1 or 3, earns 2 points.

Finding each of the solutions $(1,1,2)$ and $(2,2,3)$ earns 1 point each, corresponding to the eighth and ninth points of the above scoring scheme.