Hey I'm preparing for finals and I'm a little lost, I need your help to find the right direction... The question is how many solutions are there for the equation $x_1 + x_2 + x_3 = n $ for positive integers when:
- $x_1=2x_2$
- $x_1 \neq x_2$
- $x_1 < x_2$
For the first, I rearranged the equation to the form $3x_1 +x_3 = n $ and the generating function that matches for it is $$f(x) = \frac{3}{1-x} \frac{1}{1-x}=3 \frac{1}{(1-x)^2}=3 \sum_{k=0}^{\infty}(k+1)x^{k}$$ Thus the coefficient of $x^n$ is $3(n+1)$
Now I'll address the third problem as a step in the solution of the second. When $x_1 < x_2 $ it implies that $x_1 + x_2 +x_3 = n \iff x_1 +x_3 =n-x_2 \ and \ n-x_2<n-x_1 $ so $$ x_1+x_3>n-x_1 \iff 2x_1+x_3 < n$$ Let $k\in\mathbb{Z}$ a positive integer so that $k<n$ and we'll find the solutions for $2x_2+x_3 =k$ for every $k<n$. Again the generating function that is fitting is $\frac{2}{(1-x)^2} = 2\sum_{i=0}^{\infty}(i+1)x^i$ and the coefficient for the $k$'th power is $2(k+1)$. Let us add all the coefficients of all the powers smaller than $n$, we get $$\sum_{k=0}^{n-1}2(k+1)=n^2+n$$
For the second part, it is enough to add the number of solutions of $2x_2+x_3 < n$ to our last result and we'll cover all of the possibilities. But it is exactly the same number so the answer for that is $2(n^2+n)$
I'm not sure I know what I'm doing so go soft on me...
For the first part the solution is equal to the number of positive multiples of $3$ under $n-1$. Thus $\lfloor \frac{n-1}{3} \rfloor$
For the second one the number of solutions where $x_1=x_2$ is $\lfloor \frac{n}{2} \rfloor$. Hence you want $\binom{n-1}{2}-\lfloor \frac{n-1}{2} \rfloor$ by stars and bars.
For the third one you want exactly half of the second one. Since half of the solutions of the second one have $x_1>x_2$ and half $x_2>x_1$.