Find the number of tuples consisting of $0, 1$ and $3$ How can I find the number of tuples $(k_1, k_2, ...,k_{26})$ such that each $k_i$ equals $0, 1$ or $3$ and $k_1 + k_2 + ... + k_{26} = 15$.
I can reduce this problem to finding the coefficient of $x^{15}$ in expression $(1 + x + x^3)^{26}$, but I do not now any simple way to do it.
 A: We can successively use the binomial theorem to extract the coefficient. It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a polynomial.

We obtain 
  \begin{align*}
[x^{15}](1 + x + x^3)^{26}&=[x^{15}]\sum_{k=0}^{26}\binom{26}{k}x^{3k}(1+x)^{26-k}\\
&=\sum_{k=0}^{5}\binom{26}{k}[x^{15-3k}](1+x)^{26-k}\tag{1}\\
&=\sum_{k=0}^{5}\binom{26}{k}[x^{15-3k}]\sum_{j=0}^{26-k}\binom{26-k}{j}x^{j}\\
&=\sum_{k=0}^{5}\binom{26}{k}\binom{26-k}{15-3k}\tag{2}\\
&=853423740
\end{align*}

Comment:


*

*In (1) we use the linearity of the coefficient of operator and the rule $$[x^{n-k}]P(x)=[x^n]x^kP(x)$$
We also set the upper limit of the index $k$ to $5$, since the exponent of $x^{15-3k}$ is non-negative.

*In (2) we select the summand with $j=15-3k$ to obtain the coefficient of $x^{15-3k}$.
A: Okay, so you have options: Lets say you have $a$ 1s and $b$ 3s, and the remainder are zeros.  So you have that $a+3b = 15$.  This gives the following collection of $(a,b)$ pairs as solutions:
$$ (15,0), (12, 1), (9,2), (6,3), (3,4), (0,5),$$
or equivalently, $(15-3k, k)$ for $0 \leq k \leq 5$.
Now from a pair $(a,b)$ you obtain solutions to the original equation by choosing, from the 26 positions, $a$ places to put a 1, and from the remaining $26-a$ positions, $b$ places to put a $0$.  In other words, you have contribution of ${26 \choose a}{26-a \choose b}$ from the pair $(a,b)$.  This gives a total of
$$ \sum_{k=0}^{5} {26 \choose 15 -3k}{26-3k \choose k}.$$
This gives the same result as in the answer of Markus.
