Remainder of $3^n$ modulo $15$ Let $n \in \mathbb{N}_{>0}$. Then we have $$\begin{align*} &3 \equiv 3 \bmod 15\\&3^2 \equiv 9 \bmod 15\\&3^3 \equiv 12 \bmod 15\\&3^4 \equiv 6 \bmod 15\\&3^5 \equiv 3 \bmod 15\end{align*}$$ Hence all remainders modulo $15$ of $3^n$ should be $3,9,12$ and $6$. Why is this the case? Also, How could I calculate $$3^{1291}\equiv ? \bmod 15$$

Note that: $3^{4n} \equiv 6 \bmod 15$
$3^{1291} \equiv 3^{4\cdot 322 +3} \equiv 3^{3} \equiv 12 \bmod 15$
