0

Prove that for all $n∈ \mathbb N$, if $n^2=4q+r$ for $q,r ∈ \mathbb Z$ with $0≤r<4$, then $r = 0$ or $r = 1$.

The only way I can think is prove that $4|n^2$ or $4|n^2-1$ is true by induction. However it seems not a good idea by this way. Can anyone help?

TMM
  • 9,976
cgtea
  • 11

2 Answers2

1

We know that $n$ belongs to either $[0], [1], [2],$ or $[3] $

So

$[0]^2 = [0] $

$[1]^2 = [1] $

$[2]^2 = [0] $

$[3]^2 = [1] $

  • 1
    I assume $[\cdot]$ represents a congruence class, modulo $4$? And this assumes the OP is familiar with congruence classes. – TMM Oct 03 '16 at 18:42
  • Note that if $n \equiv \alpha \mod 4$, then $n^2 \equiv \alpha^2 \mod 4$, since modulo multiplication is well-defined. https://proofwiki.org/wiki/Modulo_Multiplication_is_Well-Defined. Therefore, if $n \in [\alpha]$, then $n^2 \in [\alpha^2]$. – jskattt797 Jul 10 '20 at 04:04
1

If $n$ is odd then $n = 2 k + 1$ for some $k \in \mathbb{N}$ and $n^2 = 4 k (k+1) + 1$ $\iff$ $q=k(k+1), r=1$.

If $n$ is even then $n = 2 k$ for some $k \in \mathbb{N}$ and $n^2 = 4 k^2$ $\iff$ $q=k^2, r=0$.

Since every integer $n$ is either odd or even, it follows that $r \in \{0,1\}$ for $\forall n \in \mathbb{N}$.

dxiv
  • 76,497