Exercise · ZW-MODULAR-CONGRUENCE-010 · ★★★ Advanced

Which remainders can a perfect square leave when divided by 4?

Choose one option.

Show answer
  • A. Only 0 and 1

Explanation

If \(n\) is even, \(n^2\equiv0\); if odd, \(n=2k+1\) and \(n^2=4k(k+1)+1\equiv1\). Never 2 or 3.

Study Discrete mathematics in ZWMath →

Review the concept: Modular congruence

Two integers \(a\) and \(b\) are congruent modulo a positive integer \(m\) if \(m\) divides their difference; equivalently, they leave the same remainder when divided by \(m\).

\[a\equiv b\pmod m\iff m\mid(a-b)\]

More practice problems: modular congruence

← ZW-MODULAR-CONGRUENCE-009