I don't understand how to use Fermat's little theorem to find remainders e.g if we are asked to find remainder of $50^{50}$ on division by $13$, what is a and what is $p$ in the formula?
Also I wanted to check can we use both congruence classes as well as Fermat's little theorem to find such remainders? How would be write $50^{50}$ on division by $13$ in terms of congruence classes to find the remainder?
I don't exactly understand what a congruence class is, what does it tell us and how is it related to this?
$50^{50} = (50^{12})^4\cdot 50^2 \equiv 1^4\cdot 4 \pmod{13} \equiv 4 \pmod{13}$