I had to find the remainder when $5^{30009}$ is divided by $7.$
I wrote the expression like this: $$(A)\ x \equiv 5^{30009} \pmod 7$$
Found that: $$ 5^6 \equiv 1 \pmod 7 $$
Then wrote $(A)$ like this: $$ (5^6)^{50001}\cdot 5^3 \equiv 5^{30009} \pmod 7$$
Replacing $5^6$ with $1$, the expression becomes, $$5^3 \equiv 5^{30009} \pmod 7 $$
Now I'm not sure how to continue from there. I can easily verify that $$125 = 17\cdot7 + 6$$ So, the remainder is $6.$ But is showing that enough or I should keep using congruence notation to solve this?