Modular arithmetic is like a clock; no matter how many hours you count, you always loop back to the starting point after a full cycle. When dealing with numbers under modular arithmetic, we work within a set 'modulus', representing numbers in a wrapped-around manner.
In this exercise, we're working with modulo 4. This means we analyze what happens when numbers are divided by 4 and look at the remainder, which is always an integer from the set {0, 1, 2, 3}.
- Square of a number with remainder 0 when divided by 4 results in a remainder of 0.
- Square of a number with remainder 1 results in a remainder of 1.
- Square of a number with remainder 2 results in a remainder of 0.
- Square of a number with remainder 3 results in a remainder of 1.
This pattern stems from how multiplication works in modular arithmetic, showing that despite the size or intricacy of numbers, their squares yield predictable remainders of 0 or 1 when divided by 4.