Modular equation with exponents on the exponents I want to solve this modular equation:

$ 7x + 5 \equiv 2^{11^{2017}} \pmod {31}$

As far as I know, dividing the exponent by 31 and substituting it with the remainder is not allowed.

I've looked here and here but I don't see how to apply that to my equation. 
I'm sorry for this short question but I don't really know how to approach this equation.
$2$ has order $5\bmod 31$, so
$$2^{11^{2017}}\equiv2^{11^{2017}\bmod 5}\pmod{31}.$$
Now $11\equiv 1\mod 5$, so $11^{2017}\equiv 1\mod 5$ and eventually $2^{11^{2017}}\equiv2^1=2\mod{31}$, so the congruence equation becomes
$$7x+5\equiv 2\iff7x\equiv -3\iff x\equiv 9(-3)=-27\equiv \color{red}{4}\mod31$$
since $7^{-1}\equiv 9\mod 31$.
To solve such question, I would simplify the right hand side first. Notice that ${(2^{11})}^{2017} \equiv 2^{2017} \pmod{31}$. Further more, $2017 = 67 \times 30 + 7$. Therefore, By Fermat's theorem, $2^{2017} \equiv {(2^{30})}^{67} \times 2^7 \equiv 1 \times 2^7 \equiv 128 \equiv 4 \pmod{31}$.

The equation finally becomes

$$7x+5 \equiv 4 \pmod{31} \to 7x \equiv -1 \pmod{31}$$

Notice that I divided by $30$ instead of $31$ when using Fermat little theorem.