When is $a^k \pmod{m}$ a periodic sequence? Let $a$ and $m$ be a positive integers with $a < m$.  Suppose that $p$ and $q$ are prime divisors of $m$.  Suppose that $a$ is divisible by $p$ but not $q$.  
Is there necessarily an integer $k>1$ such that $a^k \equiv a \pmod{m}$?  
Or is it that the best we can do is say there are $n>0$ and $k>1$ such that $a^{n+k} \equiv a^n \pmod{m}$
What can be said about $n$ and $k$?
EDIT: Corrected to have $k>1$ rather than $k>0$.
EDIT: The following paper answers my questions about $n$ and $k$ very nicely.
A. E. Livingston and M. L. Livingston, The congruence $a^{r+s} \equiv a^r \pmod{m}$, Amer. Math. Monthly $\textbf{85}$ (1978), no.2, 97-100.
It is one of the references in the paper Math Gems cited. Arturo seems to say essentially the same thing in his answer.

(Assuming you meant $k\gt 1$)
The best you can say say is that there are $n$ and $k$ such that $a^{n+k}\equiv a^n\pmod{m}$. And of course, there is a least $n$ for which there exist such $k$, and a least $k$ that make this true; in the sense that if $r$ and $s$ are any positive integers such that $a^r\equiv a^s\pmod{m}$, then $r,s\geq n$, and $r\equiv s\pmod{k}$. (These are the "cyclic monoids/semigroups".)
For example, $m=12$, $a=2$. Then $a^2\equiv 4\pmod{12}$, $a^3\equiv 8\pmod{12}$, $a^4\equiv 4\pmod{2}$, and you never get back to $2$.
The problem will arise whenever you have a prime $p$ that divides both $a$ and $m$, but the highest power of $p$ that divides $a$ is strictly smaller than the highest power of $p$ that divides $m$. 
Consider the situation one prime at a time. If $\gcd(p,a)=1$, then there is a $k_p$ such that $a^{k_p}\equiv a\pmod{p^{r_p}}$, where $p^{r_m}$ is the exact power of $p$ that divides $m$. We know that $k_p$ divides $p^{r_p-1}(p-1)$, but in general we don't know more than that. 
If $p|a$, let $p^{s_p}$ be the exact power of $p$ that divides $a$. If  $n_p=\lceil \frac{r_p}{s_p}\rceil$ we have that $n_p$ is the smallest positive integer such that $a^{n_p+1}\equiv a_{n_p}\pmod{p^{r_p}}$, and moreover, $a$, $a^2,\ldots,a^{n_p}$ are pairwise distinct modulo $p^{r_p}$. 
By the Chinese Remainder Theorem, $a^{n+k}\equiv a^n\pmod{m}$ if and only if $a^{n+k}\equiv a^n\pmod{p^{r_p}}$ for each prime $p$ that divides $m$. For primes that do not divide $a$, this implies that $k$ is a multiple of $k_p$; for primes that do divide $a$, this implies that $n\geq n_p$ and $k$ is arbitrary. 
So you can say that $n\geq \max\{n_p \mid p|\gcd(a,m)\}$ and $\mathrm{lcm}\{k_p\mid p\text{ divides }m\text{ and }p\text{ does not divide }a\}$ divides $k$.
Conversely, if $n$ and $k$ satisfy those conditions, then the value of $n$ guarantees that $a^{n+k}\equiv a^n\pmod{p^{r_p}}$ for all primes that divide $\gcd(a,m)$; and the value of $k$ guarantees that $a^{n+k}\equiv a^n\pmod{p^{r_p}}$ for all primes that divide $m$ but not $a$.
