# Elementary Number Theory – Prove that \$ 3 ^ {30} equiv 1 + 17 cdot 31 pmod {31 ^ {2}} \$.

I read "An Introduction to Algebraic Systems" by Kazuo Matsuzaka.
There are the following problems in the book.
I think this problem is simple, but I can not solve it.

Prove that $$3 ^ {30} equiv. 1 + 17 cdot 31 pmod {31 ^ {2}}$$

Of course, I can solve the above problem by direct calculation, but I want to know a smarter solution.

For example, I made the following calculation but could not solve this problem.

With Fermat's little sentence
$$3 ^ {30} equivalent 1 + 17 cdot 31 pmod {31}.$$

$$1 + 17 cdot 31 equiv (1 + 31) ^ {17} equiv 32 ^ {17} equiv 2 ^ {85} pmod {31 ^ 2}$$