When $a,b,c,n\in \mathbb{Z} , a,b,c,n\geq0$ , $a+b+c\leq8n$
How many tuples of $(a,b,c)$ satisfies the following equation?
$a+2b+3c=12n$
I've tried with $n=1$ and there were 13 tuples, but I couldn't go any further. Please teach me a solution!
When $a,b,c,n\in \mathbb{Z} , a,b,c,n\geq0$ , $a+b+c\leq8n$
How many tuples of $(a,b,c)$ satisfies the following equation?
$a+2b+3c=12n$
I've tried with $n=1$ and there were 13 tuples, but I couldn't go any further. Please teach me a solution!
On
First, see my comment, following the answer of Aidan.
In short, I found his use of $x,y,z$ very creative. However, unless I am mistaken, the inevitable $x \leq y \leq z$ constraint (again) excludes Stars and Bars.
First, I will ignore the constraint that $a+b+c \leq 8n$. Then, I will adjust for this constraint.
For a real number $r$, let $\lfloor r\rfloor$ (i.e. the floor function) denote the largest integer $\leq r.$
$c$ will run from $0$ through $4n$.
So, for a specific value of $c$, you have that the upper bound for $b$ will be $~\displaystyle \left\lfloor \frac{12n - 3c}{2}\right\rfloor.$
This implies that for such a solution, you will have that
$a + 2b + 3c = 12n \implies a = 12n - 3c - 2b.$
This implies that $a + b + c = (12n - 3c - 2b) + b + c = (12n - 2c - b).$
This implies that in order to obey the constraint that
$a + b + c \leq 8n$
you must have that
$(12n - 2c - b) \leq 8n \iff 4n - 2c \leq b.$
So, a lower bound for $b$ is $b \geq (4n - 2c)$.
Edit
Thanks to Aidan's comment, immediately following this answer, I corrected an earlier analytical mistake. I overlooked that when $(4n - 2c) < 0$, that the lower bound for $b$ changes to $0$.
However, you also have the separate lower bound of $b \geq 0$. This means that the computations must be split into two parts, depending on whether $c < 2n$ or $c \geq 2n$.
At this point, the first question to ask is, is the lower bound for $b$ of $(4n-2c)$ ever greater than the upper bound for $b$?
For $c$ even, the upper bound for $b$ is $~\displaystyle 6n - \frac{3c}{2}.$
It is clear that this upper bound must always be greater than the lower bound of $(4n - 2c).$
Further, for $c$ odd, the upper bound is only decreased by $(1/2)$.
Therefore, the upper bound for $b$ is always greater than the lower bound. Therefore the number of solutions that obey both of
will be given by
$$\sum_{c=0}^{2n-1} \left\lfloor \frac{12n - 3c}{2}\right\rfloor - (4n-2c) + 1 $$
$$+ ~\sum_{c=2n}^{4n} \left\{ ~\left\lfloor \frac{12n - 3c}{2}\right\rfloor + 1 ~\right\}. \tag1 $$
Although (1) above permits some easy computations, the general attack on a corresponding problem like
$$a + 2b + 3c + 4d = T$$
will be very ugly.
Anyway...
The only difference between
$$\left\lfloor \frac{12n - 3c}{2}\right\rfloor ~~\text{and}~~ \frac{12n - 3c}{2} \tag2 $$
is that when $c$ is odd, the LHS expression in (2) above is $(1/2)$ smaller than the RHS expression. Further, there are exactly $2n$ odd numbers in the permissible values of $c$ of $\{0,1,2,\cdots,4n\}.$
Therefore the evaluation of (1) above is equivalent to
$$ -(n) + \sum_{c=0}^{2n-1} \left(\frac{12n - 3c}{2}\right) - (4n-2c) + 1 $$
$$+ ~\sum_{c=2n}^{4n} \left(\frac{12n - 3c}{2}\right) + 1 . \tag3 $$
The expression in (3) above may be re-grouped to
$$(-n) + \sum_{c=0}^{4n} \left[6n - \frac{3c}{2} + 1\right]$$
$$- ~\sum_{c=0}^{2n-1} (4n-2c). \tag4 $$
This evaluates to
$$(-n) + \left\{ ~(6n+1)(4n+1) - \frac{3}{2}\left[\frac{4n(4n+1)}{2}\right] ~\right\} $$
$$- ~\left\{ ~(4n)(2n) - 2\left[\frac{(2n-1)2n}{2}\right] ~\right\}. \tag5 $$
(5) above equals
$$(-n) + \left[(24n^2 + 10n + 1) - (12n^2 + 3n)\right] $$
$$- ~\left[(8n^2) - (4n^2 - 2n)\right]. \tag6 $$
(6) above equals
$$(-n) + n^2(24-12-8+4) + n(10 - 3 - 2) + 1 = 8n^2 + 4n + 1.$$
First note that we have a bijection between tuples
$$\{(a,b,c)\mid 0\leq a,b,c,\ a+b+c\leq 8n,\ a+2b+3c=12n\}$$
and tuples
$$\{(x,y,z)\mid 0\leq x\leq y\leq z\leq 8n,\ x+y+z=12n\}$$
Given by $x=c$, $y=b+c$, $z=a+b+c$.
Counting this second set can be done by a modified stars and bars approach, but I think it is easier to do the following: Let $N$ be the number of solutions
\begin{align} N &= \sum_{x=0}^{8n} \#\{y+z=12n-x,\mid x\geq y\geq z\geq 0\}\\ &= \sum_{x=0}^{8n} \#\{y\mid \lceil\frac{12n-x}{2}\rceil\leq y\leq \min(x,12n-x)\}\\ &=\sum_{x=4n}^{6n} x+1-\lceil\frac{12n-x}{2}\rceil\\ &+\sum_{x=6n+1}^{8n} 12n-x+1-\lceil\frac{12n-x}{2}\rceil \end{align}
Which I think gives $N= 12n+1$, if I've done the calculations correctly
Edit: I did not do the calculations correctly. $N=8n^2+4n+1$ seems more accurate.
As for where $$N= \sum_{x=0}^{8n} \#\{y+z=12n-x,\mid x\geq y\geq z\geq 0\}$$ comes from: we know that $0\leq x\leq 8n$. The set $$\{(x,y,z)\mid 0\leq x\leq y\leq z\leq 8n,\ x+y+z=12n\}$$ can be broken into a disjoint union of sets solutions where $x=0,\ x=1,\ldots, x=8n$. So we can fix $x$ and count the number of ways of picking $y$ and $z$, and sum over all possibly choices of $x$.