Summing $n$ numbers so that they equal $0 \mod{n}$ Let $A_n=\{(a_1,a_2,\dots,a_n) :\sum_{i=1}^na_i=0\mod{n}\}$, where $a_i\in[n-1]$. How many elements are in $A_n$? My initial attempt was a stars-and-bars argument. 
For example, let $n=4$. Then we need to consider $4k$ stars ($k\in\mathbb{N}$) and $3$ bars.
If $k=1$, then there is only one way, namely $*|*|*|*$, giving $1+1+1+1$.
If $k\geq2$, we need the restriction that there may be no more than $3$ starts between any $2$ bars. I'm not sure how to account for this restriction.
Note that I consider different orderings of the sum as different summations, e.g. $1+2+3+2$ is different than $2+3+2+1$. However, a summation such as $2+2+1+3$, is the same as $2+2+1+3$ (the $2$s being switched). 
 A: You can reduce this to several computations where we count compositions with a bound on sizes of parts.  See this previous Question and its related posts for ways to do these computations.  Their asymptotics have been explored in this paper.
If $\sum_{i=1}^n a_i \equiv 0 \bmod{n}$, with each $1\le a_i \le n-1$, then the sum is a positive multiple of $n$, but not more than $(n-1)n$.  Two selections of $a_i$ are clearly distinct if they give sums with distinct multiples of $n$. 
So for each $k=1,\ldots,n-1$, we should count the compositions of $kn$ with parts less than $n$.  Adding these together gives the count sought by this Question.
The number of such computations can be cut roughly in half by the observation that $\sum_{i=1}^n a_i = kn$ is an admissible composition of $kn$ if and only if $\sum_{i=1}^n (n-a_i) = (n-k)n$ is an admissible composition of $(n-k)n$.  This means we only need to work out the counts for $k=1,\ldots,\lfloor (n-1)/2 \rfloor$, because the remaining counts have equivalence with these by the symmetry just explained.
