How can I prove the following congruence identity?
$ \forall x \in \mathbb{N}_{> 3}: \qquad 5^{2^{x}} \equiv 1 \pmod {17} $.
I have numerically verified it for $ x $ up to (at least) $ 10000 $, but I cannot understand why it is true.
This is some Python code verifying this property:
for X in xrange(10000):
if pow(5,pow(2,X),17) != 1:
print X
Note that $5^{2^4}=5^{17-1}$, hence by FLT: $5^{2^4}\equiv1\pmod{17}$.
We can use this observation in order to prove by induction.
First, show that this is true for $x=4$:
We've shown that $5^{2^4}\equiv1\pmod{17}$, hence $5^{2^4}=17n+1$.
Second, assume that this is true for $x$:
We're assuming that $5^{2^x}\equiv1\pmod{17}$, hence $5^{2^x}=17k+1$.
Third, prove that this is true for $x+1$:
$5^{2^{x+1}}=$
$(\color\red{5^{2^x}})^2=$
$(\color\red{17k+1})^2=$
$289k^2+34k+1=$
$17(k^2+2k)+1$
We've shown that $5^{2^{x+1}}=17(k^2+2k)+1$, hence $5^{2^{x+1}}\equiv1\pmod{17}$.
Please note that the assumption is used only in the part marked red.