Period of $x^n \mod y$?

There are many cases where the period is $y$ (and, as Andre points out, many cases where it is not). If $y$ is squarefree (that is, if there is no integer $d\gt1$ such that $y$ is a multiple of $d^2$), then $x^n$ is zero if and only if $x$ is 0 (modulo $y$), so the period has to be $y$.


The period need not be $y$. For example, let $y=9$, and consider the function $x^3$. This has period $3$. One can build many similar examples.