0

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!

Bill Dubuque
  • 272,048
Zen
  • 21

1 Answers1

1

Hint: for any prime $p$ and integers $a, b$ we know that $p| ab$ if and only if $p$ divides $a$ or $p$ divides $b.$

Igor Rivin
  • 25,994
  • 1
  • 19
  • 40
  • Thanks that did simply this question quite a bit. – Zen Mar 28 '21 at 14:34
  • Please strive not to add more dupe answers to dupes of FAQs. – Bill Dubuque Mar 28 '21 at 14:36
  • @BillDubuque Yes, of course. "Strive" is the key word here, alas :( – Igor Rivin Mar 28 '21 at 14:38
  • Of course! Btw, welcome back. Hope all is well. Some of us "strive" to keep our tags well-organized, but it's quite a battle given the gamification of the platform. – Bill Dubuque Mar 28 '21 at 14:39
  • By the way, when it comes to non-prime $p$, can we use the property that $[a]\cdot[b]=[a\cdot b]$ for equivalence classes $[a],[b]$ for $p=ab$ where $a,b$ are primes? – Zen Mar 28 '21 at 14:50
  • @BillDubuqueThanks! Life has been interesting :) And yes, I understand that keeping this place under control is highly non-trivial... – Igor Rivin Mar 28 '21 at 16:59