I have a equation and I need to find the number of possible integer solutions for it. The equation is of the form $$2a+2b+2c+d=n, (a,b,c,d > 0)$$
Asked
Active
Viewed 148 times
0
-
1Have you tried searching. This question or one closely similar has come up several times in the last week. – almagest Sep 11 '14 at 14:04
-
Yes, I tried but I couldn't get a solution except for the general case with no restrictions – Vivek Maskara Sep 11 '14 at 14:09
-
See also http://math.stackexchange.com/questions/602547/how-many-positive-integer-solutions-does-the-equation-x-y-z-w-15-have?rq=1, or http://math.stackexchange.com/questions/657515/how-many-solution-of-a-equations?rq=1. – Dietrich Burde Sep 11 '14 at 14:10
-
It boils down to $\sum_k\binom{2k+2}{2}$ which should give a cubic. It's pretty straightforward but perhaps there are more clever solutions. – Bart Michels Sep 11 '14 at 14:12
-
@VivekMaskara The restriction to positive integers is trivially dealt with. Anyway the idea is to help you solve things yourself, not provide solution service! :) – almagest Sep 11 '14 at 14:13
-
yep positive integers is no longer a problem. @Burde's link helped – Vivek Maskara Sep 11 '14 at 14:15
-
Is there any restriction on $n$? – Hassan Muhammad Sep 11 '14 at 14:19
2 Answers
0
Use the generating function of the LHS:
$$f(x) = (x^2+x^4+x^6+...)^3(x+x^2+x^3+...)$$
and the answer for the equation is the coefficient of $x^n$ in the generating function.
To get the cofficient, we split to disjoint events, by the size of $d$, obviously that if $n$ is even/odd then $d$ is even/odd, and then divide $n-d$ by $2$ and split it to $3$ different cells with repetitions $$CC_3^{\frac{n-d}{2}}$$
Then sum over all those events.
Snufsan
- 2,125
0
Idea:
Let $a+b+c=k$, then we have $2k+d=n$. Now for any given value of $d$ there is corresponds $3$ values of $k$. So for $m$ values of $d$ we have $3m$ values of $k$
So that we are going to have ... solutions.
Hassan Muhammad
- 4,522