Sum of all elements in congruence class modulo n

692 Views Asked by At

With $+$ defined as $[a]+[b]=[a+b]$, show that $[0]+[1]+\cdots+[n-1]$ is equal to either $[0]$ or $[n/2]$ in $\Bbb Z_n$.

How do I go about proving this? I have managed to get $[(n^2-n)/2]$ using the definition but how do I proceed from here to the result?

Help would be much appreciated, thanks in advance!

3

There are 3 best solutions below

0
On BEST ANSWER

If $n=2k+1$ is odd, $\left[\dfrac{n(n-1)}2\right]=[nk]=[0]$.

If $n=2k$ is even, $\left[\dfrac{n(n-1)}2\right]=[k(n-1)]=[-k]$.

0
On

Think about it this way: for every $[a]\in\mathbb{Z}_n$ there is a unique $[-a]\in\mathbb{Z}_n$ such that $[a]+[-a]=[0]$. Let $$S=\{[a]\in\mathbb{Z}_n\mid [a]\neq[-a]\}.$$ Prove that $$\sum_{[a]\in S}[a]=0.$$ It follows that $$\sum_{[a]\in\mathbb{Z}_n}[a]=\sum_{[a]\in S}[a]+\sum_{[a]\notin S}[a]=\sum_{[a]\notin S}[a]$$

It now remains to analyze the set of elements in $\mathbb{Z}_n$ for which $[a]=[-a]$. This will reduce to two cases: $n$ odd and $n$ even.

0
On

Without words:

$$\begin{align}&1+2+3\\ &7+6+5\end{align}\color{green}{+4}=8+8+8\color{green}{+4}$$

$$\begin{align}&1+2+3+4\\ &8+7+6+5\end{align}=9+9+9+9$$