I was asked to find all possible equivalence classes of $ab\equiv (0 \mod 5)$ for $a$ and $b$ modulo 5. If my understandings to this question is correct, there would be lots of work since we need to consider all possible permutations of $(a,b)\in[0,4]\times[0,4]$. Then I used Python to get something that's possibly a solution. Here's the code and results:
S_a = range(5)
S_b = range(5)
S = {}
for i in range(5):
S[i] = []
for a in S_a:
for b in S_b:
for i in range(5):
if ((a * b) % 5) == i:
S[i].append([a,b])
{0: [[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [1, 0], [2, 0], [3, 0], [4, 0]],
1: [[1, 1], [2, 3], [3, 2], [4, 4]],
2: [[1, 2], [2, 1], [3, 4], [4, 3]],
3: [[1, 3], [2, 4], [3, 1], [4, 2]],
4: [[1, 4], [2, 2], [3, 3], [4, 1]]}
With each list representing all pairs of $a,b$ with the same results of $ab \mod 5$. If I'm doing this correctly, is there still a shortcut or some better approaches to this question? My intuition tells me that things should come with a rigorous and concise proof. Thank you all for your helps!