# Existence of $n \in \mathbb{Z}^+$ such that $b^{3^{n}}+b^{-3^{n}} \equiv 5 \,(\bmod~p\,)$

Let $$p$$ be a prime number, $$p \equiv 2\,(\bmod~3\,), x \in \mathbb{Z}, x \neq 0\,(\bmod~p\,)$$ $$a_{n} \equiv x^{3^{n}}+x^{-3^{n}}\,(\bmod~p\,)$$ with $$a_{0} \equiv 5\,(\bmod~p\,)$$. Show that there exists a positive integer $$n$$ such that $$a_{n} \equiv 5\,(\bmod~p\,).$$

Looking for hints. Been trying Fermat's little theorem to no avail.

• Hint: the sequence $x^k \pmod p$ is periodic with period dividing $p - 1$ (application of Fermat's little theorem). Look for an $n$ such that $3^n \equiv 1 \pmod {p-1}$. (Why is there such an $n$? Look at the congruence condition on $p$). Sep 23 '20 at 12:47

By Euler's theorem, because $$\gcd(3,p-1)=1$$ and $$\gcd(x,p)=1$$ we have $$3^{\varphi(p-1)}\equiv1\pmod{p-1}\qquad\text{ and }\qquad x^{p-1}\equiv1\pmod{p}.$$ It follows that $$a_{\varphi(p-1)}\equiv a_0\pmod{p}$$.