How to find the congruence $2^{2^{19}} \equiv k \pmod{19}$? Find the $k$, $0\leq k<19$ such that $2^{2^{19}} \equiv k  \pmod{19}$.
I found that $2^{19} \equiv 2  \pmod{19}$ but I don't know how to find $2^{2^{19}} \equiv k  \pmod{19}$. Can someone help me please? Thanks.

We can start like usual, we want to reduce the exponent mod $\phi(19) = 18$
$$2^{19} \equiv 2^{7}2^{7}2^{5}\equiv 2*2* 2^5\equiv 2^7 \equiv 2\pmod {18}$$
To see why these equivalences are true, we can determine the period of $2$ mod $18$ by computing it directly:
$$2\rightarrow 4 \rightarrow 8 \rightarrow 16 \rightarrow -4 \rightarrow -8 \rightarrow -16 = 2$$
So $2^7 \equiv 2 \pmod {18}$, which we apply twice.
Then we can return to the original expression,
$$2^{2^{19}} \equiv 2^2  \equiv 4 \pmod {19}$$
