Let $x$, $y$, $n$ be positive integers, where $n$ and $y$ shall be constants and $x$ a variable. Then it is trivial that the period of
$x \bmod y$
in $x$ is $y$, since the function simply drops to zero and starts over when $x$ reaches $y$. Now, for me at least, it is much less obvious, what the period of
$x^n \bmod y$
in $x$ should be. Visually (looking at plots of the function at different $n$ and $y$) the results suggest that the period still stays $y$. How can I see that analytically?