Help proving that an integer sequence is periodic I have been trying to solve this problem and i have no idea how to proceed:
Let $p,q,n,a$ integers where
$n>0$,
$p$ and $q$ are relative primes and
$a \neq 0$.
Prove that: 
$$(aq^k \text{mod } p^n \ : \ k\geq 0),$$
is periodic of period $T_n$.
Also prove that for $n$ sufficiently large holds that $T_n=C p^n$, where $C$ is a constant and that the elements in $(aq^k \text{mod } p^n \ : \ 0\leq k < T_n)$ are all diferent.
Any help will be appreciated.
 A: Karvens answer is indeed true, but in general such a result follows from the fact that $f(x)=aq^{x}$ is a $p$-adic analytic function (or is at-least analytic over some sub-sequence, as the $p$-adic exponential have finite radius of convergence).
A: It suffice to only consider the case where $p$ is prime. If $aq^k\pmod(p^n)$ has period $T_n(p)$ then $aq^k\pmod{(p_1^{q_1}p_2^{q_2}\cdots p_t^{q_t})^n}$ has period $$\gcd(T_n(p_1^{q_1}),T_n(p_2^{q_2})\cdots T_n(p_t^{q_t}))=C'p_1^{q_1}\cdots p_t^{q_t}$$
Like @user90803 said in the comment, periodicity is easily followed by the pigeonhole principle.
Since $|\mathbb{Z}_{p^n}|=p^n$ there is some $1\le i<j\le p^n+1$ that $aq^i\equiv aq^j\pmod{p^n}$ by the pigeonhole principle. Then $aq^n\equiv aq^{n+(j-i)}\pmod{p^n}$ so $aq^k$ have period $j-i$.
Let $v_p(n)$ be the largest $t$ that $p^t|n$. Let $b=a/p^{v_p(a)}$ and $c$ the least of the numbers that $p|q^c-1$. We now divide cases.
Case 1. $p$ is an odd prime.
Put $d=q^c$ for convenience. We will prove by induction on $v_p(n)$ that $$v_p(d^n-1)=v_p(d-1)+v_p(n)\tag{1}$$
If $v_p(n)=0$, $$d^n-1=(d-1)(d^{n-1}+d^{n-2}+\cdots+1)$$ and $d^{n-1}+d^{n-2}+\cdots+1\equiv n\not\equiv0\pmod{p}$ so $v_p(d^n-1)=v_p(d-1)$.
Assume $v_p(d^n-1)=v_p(d-1)+v_p(n)$. From $p|d^n-1$, we have $d^n=pt+1$ for some $t$. Then \begin{align}d^{(p-1)n}+d^{(p-2)n}+\cdots+1&\equiv((p-1)pt+1)+((p-2)pt+1)+\cdots+1\\&=\frac{(p-1)p^2}{2}t+p\equiv p\pmod{p^2}\end{align} so from $$d^{pn}-1=(d^n-1)(d^{(p-1)n}+d^{(p-2)n}+\cdots+1)$$ we have $v_p(d^{pn}-1)=v_p(d^n-1)+v_p(d^{(p-1)n}+d^{(p-2)n}+\cdots+1=v_p(d-1)+v_p(pn)$. Thus $(1)$ is proven.
From $(1)$, $v_p(q^{cn}-1)=v_p(q^c-1)+v_p(n)$. From the definition of $c$, we also have $v_p(q^k-1)=0$ for $c\not|k$. Hence $\min\{k:b\equiv bq^k\pmod{p^n}\}=cp^{n-v_p(q^c-1)}$ for all $n\ge v_p(q^c-1)$ and therefore $$\min\{k:a\equiv aq^k\pmod{p^n}\}=cp^{n-v_p(a)-v_p(q^c-1)}$$ if $n\ge v_p(a)+v_p(q^c-1)$
Case 2. $p=2$
In this case, $q$ must be odd so $c=1$ and $8|q^2-1$. We let $q^2=d$. Now $$d^{2n}-1=(d^n-1))(d^n+1)$$ and $d^n+1\equiv 1^n+1=2\pmod{8}$. So $v_2(d^{2n}-1)=v_2(d^n-1)+1$ and from this we easily get $v_2(d^n-1)=v_2(d-1)+v_2(n)$. Similarly to the first case, we can conclude by $$\min\{k:a\equiv aq^k\pmod{2^n}\}=2^{n-v_2(q^2-1)+1-v_2(a)}$$ for all $n\ge v_2(a)+v_2(q^2-1)-1$.
