Why does $g^p = mN + 1$?

239 Views Asked by At

In this video https://www.youtube.com/watch?v=lvTqbM5Dq4Q at 5:20, he says that: If you have a number, $N$, and a smaller number that is not a factor, $g$, you can raise $g$ to some power, $p$, so that it is equal to a multiple of $N$ plus one.

$g^p = mN + 1$. I have searched for a proof for this but have been unable to find one. Could anyone explain this or let me know where I can read more. Thank you :)