<s>[INST] Prove $4p-3$ is a square knowing that $n\mid p-1$ and $p\mid n^3-1$, $p$ prime I really need some help at this problem:

Let $p$ be a prime number and $n$ a natural number, $n\ge2$ such that $n  \mid  p-1$ and $p \mid  n^3-1$. Prove that $4p-3$ is a square.

So $p \mid (n-1)(n^2+n+1)$
What if $p \mid n-1$? 
 Treating the cases wasn't too efficient.
I was thinking about Fermat's theorem but it didn't helped really much. 
A hint would be really apreciated.
Thanks!
 [/INST] Note $p \mid n-1$ is impossible because $n \le p-1$, so we have $p \mid n^2+n+1$.
Since $n \mid p-1$, we can write $p = an+1$ for some integer $a \ge 1$. Since $p \mid n^2+n+1$, we can write $$n^2 + n + 1 = bp = b(an+1)$$ for some integer $b \ge 1$.
Reducing modulo $n$ gives $1 \equiv b \pmod{n}$, so write $b = rn+1$ for some integer $r \ge 0$. Putting this in the above equation gives
$$n^2 + n + 1 = (rn+1)(an+1).$$

 If $r \ge 1$, then $(rn+1)(an+1) \ge (n+1)^2 > n^2+n+1$, which is a contradiction. So $r = 0$, $b = 1$, and $n^2 + n + 1 = p$, so we get $4p-3 = (2n+1)^2$.

</s>