This is a question from a math olympiad in Morocco.

Let $n\in \mathbb N$ and $p$ is a prime, show that if $$p\mid n^3-1\text{ and }n\mid p-1$$ then $4p-3$ is a perfect square.

we have $p\mid n^3-1 \implies p\mid n-1$ or $p\mid n^2+n+1$.

the first case is impossible, hence $n^2+n+1=pm$ $$4n^2+4n+1=(2n+1)^2=4pm-3$$ how can I show that $m=1$?


Solution 1:

First note that this is currently false when $n=1$, so we'll assume $n \geq 2$, in which case your argument goes through (do you see which step in your argument is invalid when $n=1$?)

Then $$n \mid n^2 + n - (p-1)m = m-1$$

If $m \neq 1$, then this implies $m \geq n+1$.

Since additionally, we have $n | p-1$ and $p \neq 1$, it follows that $p \geq n+1$.

Therefore $$n^2 + n + 1 = mp \geq (n+1)^2 = n^2 + 2n + 1 \implies n \leq 0$$ which is a contradiction. Therefore $m=1$.