Coefficients of $(1+x+\dots+x^n)^3$? Consider the following polynomial:
$$ (1+x+\dots+x^n)^3 $$
The coefficients of the expansion for few values of $n$ ($n=1$ to $5$) are:
$$ 1, 3, 3, 1 $$
$$ 1, 3, 6, 7, 6, 3, 1 $$
$$ 1, 3, 6, 10, 12, 12, 10, 6, 3, 1 $$
$$ 1, 3, 6, 10, 15, 18, 19, 18, 15, 10, 6, 3, 1 $$
$$ 1, 3, 6, 10, 15, 21, 25, 27, 27, 25, 21, 15, 10, 6, 3, 1 $$
Is there a closed-form formula for the $i$th element of this sequence (for different values of $n$)? 
Edit This looks similar to the sequence A109439 on OEIS corresponding to the coefficients of the expansion of: $ \left( \frac{1 - x^n}{1 - x} \right)^3 .$

If the polynomial were replaced by an infinite sum, the coefficient of $x^i$ would be equal to the number of ways to choose $(a,b,c) \in \{0,1,2,...\}^3$ such that $a+b+c=i$.  This is equal to the number of ways to choose two numbers $\le i$, or $\frac{1}{2}(i+1)(i+2)$.  The only difference here is that you want to limit the count to cases where $a,b,c \le n$.  Using the inclusion-exclusion principle, you can subtract the cases where one of the numbers is greater than $n$, add back the cases where two of the numbers are greater than $n$, and subtract the cases where all three are greater than $n$.  For each of these counts, subtract $n+1$ (or $2n+2$ or $3n+3$) from the target sum first, returning you to the case where all three numbers are unrestricted.  The result is
$$
\begin{eqnarray}
a_{i,n}&=&\frac{1}{2}(i+1)(i+2) - \frac{3}{2}(i-n)(i-n+1)\Theta(i-n-1) \\
&=& + \frac{3}{2}(i-2n-1)(i-2n)\Theta(i-2n-2) - \frac{1}{2}(i-3n-2)(i-3n-1)\Theta(i-3n-3),
\end{eqnarray}
$$
where $\Theta(x)=1$ for $x\ge 0$ and $0$ for $x<0$.
