0^2 = 0, 0 mod 4 = 0
1^2 = 1, 1 mod 4 = 1
2^2 = 4, 4 mod 4 = 0
3^2 = 9, 9 mod 4 = 1
我直接寫咁o5ok
:
Since numbers larger than 4 simply repeat the same behavior modulo 4, we don’t need to check numbers like 5, 6, 7, 8, etc. They behave exactly the same as 1, 2, 3, and 0 (respectively) modulo 4.
because 5 and 1 are congruent modulo 4 (5 ≡ 1 mod 4).
because 6 and 2 are congruent modulo 4 (6 ≡ 2 mod 4).
because 7 and 3 are congruent modulo 4 (7 ≡ 3 mod 4).
And so on …