<s>[INST] How to prove that $50^{44}+30! \cdot44^{50}-24 $ is divisible by $31$? I am struggling with this example. This is a new topic for me. I would really appreciate some hints to understand it. I need part a) and b) to conclude the excercise.
I was thinking about Fermat, Euler or Wilson theorems but I am not sure if it is correct, of course I can use properties of congruences in number theory.
Part a): show that $50^{44}+30! \cdot 44^{50}-24 $ is divisible by $31$
Part b) : Conclude that $ (50^{44}+30!\cdot 44^{50})^{\varphi(31)} \equiv 1 \pmod{ 31}$
 [/INST] \begin{align}
50^{44} + 30! \cdot 44^{50} &\equiv 50^{44} - 44^{50} \pmod{31}, \text{ By Wilson's Theorem } \\
&\equiv 2^{44} \cdot 5^{88} - 2^{100}\cdot 11^{50} \pmod{31} \\
&\equiv 2^{14}\cdot 5^{28} - 2^{10} \cdot 11^{20} \pmod{31}\text{, By Fermat's little Theorem } \\
&\equiv 2^{4} \cdot 5 - (-3)^{10} \pmod{31}, \\
&\equiv 2^4 \cdot 5 - 3^{10} \pmod{31} \\
&\equiv 2^4  \cdot 5 - 3^{3\times 3}\cdot 3 \pmod{31} \\
&\equiv 2^4 \cdot 5 - (-4)^3 \cdot 3 \pmod{31} \\
&\equiv 2^4 (5+12) \pmod{31} \\
&\equiv 2^4 (2^4+1) \pmod{31}
\\ &\equiv2^8  + 2^4 \pmod{31} \\
&\equiv 2^3 + 2^4 \pmod{31} \\
&\equiv 24 \pmod{31}
\end{align}
</s>