# Why can r1 and r2 be only 0,1 and 2?

While teaching probability, my teacher gave me an example which is as follows :

If $$a$$ and $$b$$ $$\in I$$, then find the probability such that $$a^2 + b^2 = 3\lambda ~$$ for $$\lambda \in$$ I

Now my teacher assumed 'a' and 'b' to be $$3k+ r_1$$ and $$~3p + r_2$$ respectively where $$k,p$$ are whole integers but then he also said that $$r_1, r_2 \in \{0,1,2\}$$ which I don't understand why ? since what would be the problem if $$r_1$$ and $$r_2$$ were also any other integers. If they were any other integers than wouldn't that mean that we are just describing a and b as multiple of 3 + some other integers (I get why we are doing that). But not why we are limiting the values of r1 and r2 ?

• Forcing the remainders to be less than 3 makes perfect sense ... it simplifies the problem. This way you know $k$ completely controls the multiple of $3$, and $r$ is strictly $a$ mod $3$. Aug 14, 2021 at 13:28
• $4 = 1 \cdot 3 + 1, 5 = 1 \cdot 3 + 2, 6 = 2 \cdot 3 + 0, 7 = 2 \cdot 3 + 1$ and so on. We can write any integer in this form where $k, p$ are integers and $r_1, r_2 \in \{0,1,2\}$. Aug 14, 2021 at 13:40
• "...wouldn't that mean that we are just describing $a$ and $b$ as multiple of $3$ + some other integers?" Answer: Yes, but that is not just. A multiple of $3 + \{0,1,$ or $2\}$ (s̶o̶m̶e̶ ̶o̶t̶h̶e̶r̶ ̶i̶n̶t̶e̶g̶e̶r̶s̶) makes the whole set of integers. $\{3q+r \: | \: q \in \Bbb Z, r \in \{0,1,2\}\}=\Bbb Z$. Hence, $a \in \Bbb Z \iff a=3k+r_1$ where $k \in \Bbb Z, r_1 \in \{0,1,2\}$. Aug 14, 2021 at 14:21