Let
$$ S_n= \left[\frac{2}{n}\right]+\left[\frac{4}{n}\right]+\cdots+\left[\frac{2(n-1)}{n}\right] $$
where $n$ is an odd integer such that $n\geqslant 3$, and $[x]$ is the integer part of $x$. Show that $$S_n=\frac{n-1}{2}.$$
I thinked about using induction ! But no results.
Notice that $$[a] = a - \{a\}$$ where $\{ a\}$ denotes the fractional part of $a$ Now we may rewrite the sum as $$S_n=\frac{(n+1)*(n+2) }{n}+ \{\frac{2}{n}\}+\{\frac{4}{n}\}+........+\{\frac{2(n+1)}{n}\}$$ Notice that if $a$ is congruent to $c$ modulo $b$ and $c<b$ then $\{\frac a b\} = \frac c b$ If $n$ is odd then $2*i$ is a permutation of all residues $i$ of $n$, thus we may evaluate the above sum as $$S_n=\frac{(n+1)*(n+2) }{n}+ (n-1) + 2 + 2/n = \frac {2*n*(n+1)+2}{n} $$