Let $r, p$ prime such that $r \mid (p-1)$ and $p \mid (r^3-1)$. Why does it hold that $p \mid (r^2+r+1)$?
(This is from the writeup of a cryptography challenge where the author made that statement without further explanation.)
Let $r, p$ prime such that $r \mid (p-1)$ and $p \mid (r^3-1)$. Why does it hold that $p \mid (r^2+r+1)$?
(This is from the writeup of a cryptography challenge where the author made that statement without further explanation.)
We have $$ p\mid r^3-1=(r^2+r+1)(r-1), $$ hence either $p\mid r^2+r+1$ or $p\mid r-1$. Can we have both $p\mid r-1$ and $r\mid p-1$?