<s>[INST] Last 3 digits of $7^{12341}$ I know that I need to reduce $7^{12341} \pmod {1000}$
By Euler I have $7^{\phi(1000)}\equiv 7^{400}\equiv1\pmod{1000}$
That leaves me with the monster $7^{341}\pmod{1000}$ 
Is there a way to reduce this smoothly without working $7^2, 7^4, 7^8$ etc manually ?
 [/INST] $$7^2=50-1$$
$$7^{20n+1}=7(7^2)^{10n}$$
Now $(7^2)^{10n}=(50-1)^{10n}=(1-50)^{10n}$
Using Binomial Theorem,
$(7^2)^{10n}=1-\binom{10n}150+\binom{10n}2(50)^2\cdots+(50)^{2n}$
$\implies(7^2)^{10n}\equiv1-500n+\dfrac{10n(10n-1)}250^2\pmod{1000}\ \ \ \ (1)$ for $n\ge2$
Again, $\dfrac{10n(10n-1)}250^2=50n^2(50^2)-5n(2500)\equiv-500n\pmod{1000}$ as $2500\equiv100\pmod{200}\implies5(50^2)\equiv5\cdot100\pmod{5\cdot200}\equiv500$
From $(1),$
$(7^2)^{10n}\equiv1-500n-500n\pmod{1000}\equiv1$
Here $n=\dfrac{12341 -1}{20}$
</s>