How do I find the number of integral solutions to the equation -
$$2x_1 + 2x_2 + \cdots + 2x_6 + x_7 = N$$
$$x_1,x_2,\ldots,x_7 \ge 1$$
I just thought that I should reduce this a bit more, so I replace $x_i$ with $(y_i+1)$, so we have:
$$y_1 + y_2 + \cdots + y_6 = \tfrac{1}{2}(N + 13 - y_7)$$
$$y_1,y_2,\ldots,y_7 \ge 0$$
I will be solving this as a programming problem by looping over $y_7$ from $[0, N+13]$. How do I find the number of solutions to this equation in each looping step?
Note $x_7$ must be either odd or even depending on whether $N$ is odd or even. So if you just subtract $1$ from $N$ if necessary and assume $x_7 = 2y$ where $y \geq 0$, then you get that the number of solutions is the same as the number of solutions to $x_1 + \ldots + x_7 = N/2$ where $x_i \geq 1$ for $1 \leq i \leq 6$ and $x_7 \geq 0$. This can be solved with a single binomial coefficient (no big summation required), see the "stars and bars" construction for how to do it, basically you just add 1 to the target sum $N/2$ for each variable that is $\geq 0$ instead of $\geq 1$, and then if you have target sum $M$ and $k$ variables all $\geq 1$ then the number of solutions is ${M-1} \choose {k-1}$.