How to find the modulus of a big number with a big power?
Such as $2222^{5555}$ or $5555^{2222}$ (mod 7)?
How to find the modulus of a big number with a big power?
Such as $2222^{5555}$ or $5555^{2222}$ (mod 7)?
On
5551 is divisible by 7
So, $$5555 \equiv 4 (mod 7) $$
raise both sides to power 3: $$5555^3 \equiv 4^3 (mod 7)$$
But, $$4^3 \equiv 1(mod 7)$$
It gives $$5555^3 \equiv 1(mod 7)$$
now, since 2222 is not divisible by 3, but 2220 is, 2220=740 $\cdot$3,
raise both sides to 740 $$(5555^3)^{740}=1^{740} (mod 7)$$ i.e. $$5555^{2220}=1 (mod 7)$$
Also, $$5555^2 \equiv 2(mod 7)$$ So, multiplying both, you get $$5555^{2222}=2(mod 7)$$
You can proceed similarly for $$2222^{5555} (mod 7)$$
Hint: $$2222\equiv 3 \mod 7$$ and $$3^6\equiv 1 \mod 7$$, $$5555 \equiv 4\mod 7$$ and $$4^3\equiv 1 \mod 7$$