TITLE: Prove $\sum\limits_{i=k}^{n-1}\{\frac{\binom{i}{k}}{n}\}=\frac{n-k^{w(n)}}{2}$
QUESTION [9 upvotes]: $k$ is an odd number, $(n,k!)=1$, prove that
$$\sum_{i=k}^{n-1}\left\{\frac{\binom{i}{k}}{n}\right\}=\frac{n-k^{w(n)}}{2},$$
where $\{x\}=x-[x]$, $w(n)$ is the number of distinct prime factors of $n$.
For example, if $p>k$ is prime then 
$$\sum_{i=k}^{p-1}\left\{\frac{\binom{i}{k}}{p}\right\}=\frac{p-k}{2}.$$

REPLY [2 votes]: When $k=1,$ the proof is trivial.  Suppose $k\geq 3$ and $n$ has one 
distinct prime factor (meaning $n$ is a prime greater than $k$). Since both $n$ and $k$ are odd, the number of terms $n-k$ in the sum is even.  

Define $C_i = \binom{i}{k}.$  
Consider the sum $C_{k+j} + C_{n-1-j}$ for $j=0\dots (n-k)/2-1:$
$$
  \begin{align}
  \binom{k+j}{k} + \binom{n-1-j}{k} &= \frac{(k+j)!}{k! j!} + \frac{(n-1-j)!}{k! (n-1-j-k)!} \nonumber \\
  &= \frac{(k+j)!(n-1-j-k)! + (n-1-j)!j!}{k! j! (n-1-j-k)!}. \tag{1}\label{eqn1}
  \end{align}
$$
If this sum is divisible by $n,$ the sum of the the remainders when
dividing $C_{k+j}$ and $C_{n-1-j}$ by $n$ must be $n$ (since
neither $C_{k+j}$ nor $C_{n-1-j}$ is divisible by $n$).  


The numerator of \eqref{eqn1} can be written
$$
  (n-(j+k+1))! \big((k+j)! + j!(n-(j+k))(n-(j+k-1))\cdots (n- (j+1))\big).
$$
The term
$$
  j!(n-(j+k))(n-(j+k-1))\cdots (n-(j+1))
$$
is a polynomial in $n$ with constant term $-(j+k)!,$ so the numerator
of \eqref{eqn1} is divisible by $n.$
So the sum of all the remainders of the $C_i$ when divided by $n$ is
$n(n-k)/2;$ dividing the sum of remainders by $n$ gives the sum in the 
problem.  


If $n$ has multiple distinct prime factors, each factor must be 
greater than $k$ and $n$ must still be odd.  I have not completely worked
out the proof in this case, but I don't think it's too hard.  It boils
down to computing the number of pairs of remainders that sum to zero
rather than $n$ because $C_{k+j}$ and $C_{n-1-j}$ are divisible by
all the prime factors of $n.$