Hi guys, Here's a combinatorial nut to crack. I've been struggling with this one:
Count the number of ways summing a set of $n$ non negative integers $i_1, \cdots, i_n \in \{ 0, \cdots , n-1\} $ so the sum is an integer multiple of $n$; under the condition that the first $i_j$ is unique: $i_1 \neq i_2, \cdots i_n$.
The sums can obviously range from $ 0 $ to $ n(n-1)$ and we have $n$ such sums to consider. Without the uniqueness of $i_1$ the problem is pretty straight forward to solve using a generating function $(1 + x + x^2 + \cdots x^{n-1})^{mn}$ for $m = 0 , \cdots , n-1$. Any idea of what the full answer could be?
I don't have any idea of what the answer would be, but instead I will give you the exact answer...but don't get very excited, I didn't say "closed form" answer. Maybe "The Oracle" (Zeilberger's creations, or Mathematica or something similar) yields the definitive answer.
The idea is to apply a very nasty inclusion-exclusion argument.
For each $r,s\in\mathbb Z$ such that $0\leq r\leq n-1$ and $0\leq s\leq n-1$, let $A_{r,s}$ be the set of $n$-tuples $(i_1,\dots,i_n)\in\{0,1,\dots,n-1\}^n$ such that $i_1=r, i_1+i_2+\cdots+i_n=sn$ and $i_j\ne r$ for $j=2,\dots,n$. These sets $A_{r,s}$ are clearly mutually disjoint and their union is your required set.
Now $A_{r,s}$ corresponds to the set $$\bigl\{(j_1,\dots,j_{n-1})\in\{0,1,\dots,n-1\}^{n-1}: j_1+\cdots j_{n-1}=sn-r,$$
$$j_k\ne r\ \style{font-family:inherit;}{\text{for}}\ k=1,\dots,n-1\bigr\}\,;$$
A "bad" $(n-1)$-tuple $(j_1,\dots,j_{n-1})\in\mathbb N^{n-1}$ such that $j_1+\cdots+j_{n-1}=sn-r\ $ is one tuple such that $j_k=r\ $ or $\ j_k\geq n\ $ for some $k$. For each nonempty subset $K$ of $\{1,\dots,n-1\}$, let
$$B_K=B_{r,s,K}=\bigl\{(j_1,\dots,j_{n-1})\in\mathbb N^{n-1}: j_1+\cdots j_{n-1}=sn-r,$$
$$j_k\in\{r,n,n+1,\dots\}\ \style{font-family:inherit;}{\text{for}}\ k\in K\bigr\}\,.$$
Now for each subset $S$ of $K$ (even $S=\emptyset$) consider the subset
$$B_{S,K}=\bigl\{(j_1,\dots,j_{n-1})\in B_K: j_k=r\ \style{font-family:inherit;}{\text{for}}\ k\in S, j_k\geq n\ \style{font-family:inherit;}{\text{for}}\ k\in K\setminus S\bigr\}\subseteq B_K$$
(happily, the conditions $a=r$ and $a\geq n$ are mutually disjoint, otherwise this would be worse). It follows that the set $B_{S,K}$ corresponds to the set
$$\bigl\{(t_1,\dots,t_{n-1-|S|})\in\mathbb N^{n-1-|S|}: t_1+\cdots+t_{n-1-|S|}=sn-r-r\cdot|S|-n\cdot|K\setminus S|\bigr\}\,,$$
whose cardinality is well-known (though I always forget it), namely,
$$\binom{\bigl(n-1-|S|\,\bigr)+\bigl(sn-r-r\cdot|S|-n\cdot|K\setminus S|\,\bigr)-1\ }{\bigl(n-1-|S|\,\bigr)-1}\,,$$
which depends only on $|S|$ and $|K|\,$. Thus, the cardinality of $B_K$ is given by
$$|B_K|=\sum_{S\subseteq K}|B_{S,K}|=\sum_{p=0}^{|K|}\sum_{\substack{S\subseteq K\\ |S|=p}}|B_{S,K}|=\sum_{p=0}^{|K|}\binom{|K|}p\binom{n-2-p+sn-r-rp-n\cdot|K|+np}{n-2-p}=b_{|K|}\,.$$
Therefore, by inclusion-exclusion principle (and the fact that $|B_K|$ depends only on $|K|\,$), the number of "bad" tuples is
$$\sum_{q=1}^{n-1}(-1)^{q-1}\sum_{\substack{K\subseteq\{1,\dots,n-1\}\\|K|=q}}|B_K|=\sum_{q=1}^{n-1}(-1)^{q-1}\binom{n-1}qb_q=c_{r,s}\,.$$
Consequently we have
$$|A_{r,s}|=\bigl|\,\bigl\{(j_1,\dots,j_{n-1})\in\mathbb N^{n-1}: j_1+\cdots+j_{n-1}=sn-r\bigr\}\bigr|-c_{r,s}=\binom{(n-1)+(sn-r)-1}{(n-1)-1}-c_{r,s}=d_{r,s}\,.$$
Thus, the required number is $$\sum_{0\leq r,s\leq n-1}d_{r,s}\,.$$
Enjoy!!