8

Number of elements in set $$ S = \left\{\left(x,y,z\right): x,y,z \in \mathbb{Z},\ x + 2y + 3z = 42,\ x,y,z \ge 0\right\}\ \mbox{is}\ ? $$

My solution:

This is equal to the coefficient of $t^{42}$ in \begin{align} &(1+t+t^2+t^3+\dots+t^{42})(1+t^2+t^4+\dots+t^{42})(1+t^3+t^6+\dots+t^{42}) \\ &= \frac{1-t^{43}}{1-t} \cdot \frac{1-t^{44}}{1-t^2} \cdot \frac{1-t^{45}}{1-t^3} \\ &= \frac{1} {(1-t)(1-t^2)(1-t^3)} \quad [\text{since I neglected higher powers of $t$}] \\ &= \frac{1} {(1-t)^3(1+t)(1+t+t^2)} \\ &= \frac{(1-t)^{-3}} {(1+t)(1+t+t^2)} \end{align}

Now I know the coefficient of $x^n$ in $(1-x)^{-r}$ is $\binom {n+r-1}{r-1}$.

But I don't know what to do with the denominator part. Can someone help??

mr_e_man
  • 5,986
  • I cannot answer to your question dealing with the method you have used. Let me only say that there are simpler approaches : see here for example by reducing the issue to the solution of equations $x+2y=3m$ (because $x+2y$ is necessarily a multiple of 3) for values of $m$ ranging from $0$ to $14$ – Jean Marie Mar 17 '24 at 07:04
  • Write the denominator$ (1+t^3)$ which becomes $(1+t^3)^{-1}$ .Now I hope you can take it from here. – Sisanta Chhatoi Mar 17 '24 at 07:10
  • @SisantaChhatoi could you explain in a little detail what to do after that? – Maths lover Mar 17 '24 at 07:36
  • @Mathslover you know the formula of negative indices as you mentioned above . So expand $(1+t^3)$ according to it and find coeff of $t^42$ which will be formed by multiplying terms of $(1-t)^{ -3}$ and $(1-t^3)^{ -1}$ – Sisanta Chhatoi Mar 17 '24 at 07:41
  • 3
    The OEIS sequence A001399 is the number of solutions to $x+2y+3z=n$. – Somos Mar 17 '24 at 10:44
  • @SisantaChhatoi Is it applicable even if I take, say $x^2$ or $x^3$ in the formula as well? like this: $\displaystyle{(1-x^2)^{-n}=1+\binom{n}{1}x^2+\binom{n+1}{2}x^4 +\binom{n+2}{3}x^6+\cdots\textrm{till}:: \infty}$ – Maths lover Mar 17 '24 at 12:03
  • Yes exactly just replace x with $x^2$ or any other power. – Sisanta Chhatoi Mar 17 '24 at 12:27

6 Answers6

3

I see the thread length and think that it is overcomplicated. Indeed,

$$|S| = \{(x,y,z)\in (\mathbb N\cup\{0\})^3: x+2y+3z=42\}|=$$ $$\{(y,z)\in (\mathbb N\cup\{0\})^2: 2y+3z\le 42\}|=$$ $$\sum_{z=0}^{42/3} 1+\left\lfloor\frac{42-3z}2\right\rfloor=$$ $$\sum_{t=0}^{42/6} 1+(21-3t)+\sum_{t=0}^{42/6-1} 1+(21-3t-2)=$$ $$22\cdot 15-3\sum_{t=0}^7 t-\sum_{t=0}^6 (3t+2)=$$ $$330-3\cdot\frac {7\cdot 8}2-3\cdot\frac {6\cdot 7}2-7\cdot 2=$$ $$330-3\cdot 28-3\cdot 21-14=$$ $$330-7\cdot (12+9+2)=330-161=169.$$

Alex Ravsky
  • 106,166
2

Just use partial fractions. Write $$ \frac{1}{(1-t)^3(1+t)(1+t+t^2)}=\frac{A_1}{1-t}+\frac{A_2}{(1-t)^2}+\frac{A_3}{(1-t)^3}+\frac{B}{1+t}+\frac{C_0+C_1t}{1+t+t^2}. $$

Multiplying LHS by $1+t$ and letting $t=-1$ yields $$ B=\left[\frac{1}{(1-t)^3(1+t+t^2)}\right]_{t=-1}=\frac{1}{(1+1)^3(1-1+1)}=\frac{1}{8}. $$

Multiplying LHS by $(1-t)^3$ and letting $t=1$ yields $$ A_3=\left[\frac{1}{(1+t)(1+t+t^2)}\right]_{t=1}=\frac{1}{(1+1)(1+1+1)}=\frac{1}{6}. $$

You can keep going like this (using your favorite method of partial fraction expansion) to obtain the following: \begin{multline*} \frac{1}{(1-t)^3(1+t)(1+t+t^2)}=\\ =\frac{1}{6}\cdot\frac{1}{(1-t)^3}+\frac{1}{4}\cdot\frac{1}{(1-t)^2}+\frac{17}{72}\cdot\frac{1}{1-t}+\frac{1}{8}\cdot\frac{1}{1+t}+\frac{1}{9}\cdot\frac{2+t}{1+t+t^2}. \end{multline*}

Everything except the last summand is expands easily into a power series, and for the last summand we can write $$ \frac{2+t}{1+t+t^2}=\frac{(1-t)(2+t)}{(1-t)(1+t+t^2)}=\frac{2-t-t^2}{1-t^3}=\frac{2}{1-t^3}-\frac{t}{1-t^3}-\frac{t^2}{1-t^3}. $$

Thus, noticing that $\dfrac{17}{72}=\dfrac{1}{8}+\dfrac{1}{9}$, we have $$ \begin{split} [t^n]\frac{1}{(1-t)^3(1+t)(1+t+t^2)} &=\frac{1}{6}\binom{n+2}{2}+\frac{1}{4}\binom{n+1}{1}+\frac{17}{72}+\frac{(-1)^n}{8}+\frac{-1+[3 \text{ if } 3\mid n]}{9}\\ &=\frac{n^2+6n+5+3[2\mid n]+4[3\mid n]}{12}, \end{split} $$ where "$[\cdot]$" is the Iverson bracket (i.e. $1$ if the statement in the bracket is true, and $0$ if it is false).

In this case, $2\mid 42$ and $3\mid 42$, so $[2\mid 42]=1$ and $[3\mid 42]=1$, and thus $$ \begin{split} [t^{42}]\frac{1}{(1-t)^3(1+t)(1+t+t^2)}&=\frac{42^2+6\cdot 42+5+3\cdot 1+4\cdot 1}{12}\\ &=\frac{42^2+6\cdot 42+12}{12}\\ &=\frac{42\cdot 48+12}{12}=42\cdot4+1=169. \end{split} $$

Alexander Burstein
  • 4,588
  • 16
  • 33
2

Let $p_k(n)$ be the number of partitions of $n$ in which the largest part has size $k$. Then, we have the recurrence $$p_k(n)=p_k(n-k)+p_{k-1}(n-1).$$ Note that $p_1(n)=1$ and $p_2(n)=\lfloor\frac n2\rfloor$. By reccurence, we can have a formula for $p_3(n).$

We have $p_1(42)=1$, $p_2(42)=21$, $p_3(42)=147$ and $$1+21+147=169.$$

Bob Dobbs
  • 15,712
1

Let $$A=\frac{1} {(1-t)(1-t^2)(1-t^3)}$$ Then we can say that $$A=(1-t)^{-1}(1-t^2)^{-1}(1-t^3)^{-1}$$ and it is well known that for $\displaystyle{(1-x)^{-n}=1+\binom{n}{1}x+\binom{n+1}{2}x^2 +\binom{n+2}{3}x^3+\cdots\textrm{till}\:\: \infty}$

where $n$ is a positive integer. I hope you can continue from here.

1

There is a very nice and short way about it.

Realize that $x+z$ must be EVEN.

Case 1: Both $x$ and $z$ are EVEN

Let $x=2a$ and $z=2b$.

So the equation reduces to $a+y=21-3b$

The number of non-negative integral solutions to the above equation is $22-3b$.

So the number of solutions = $$\sum_{b=0}^7(22-3b)=92$$

Case 2: Both $x$ and $z$ are ODD

Let $x=2a-1$ and $z=2b-1$.

So the equation reduces to $a+y=19-3b$

The number of non-negative integral solutions to the above equation is $20-3b$.

So the number of solutions = $$\sum_{b=0}^6(20-3b)=77$$

So number of solutions to the equation =Case 1+Case 2= $$92+77=169$$

Maverick
  • 10,736
1

We can write $x+2y+3z=42$ as $$z+(y+z)+(x+y+z)=42$$

Here, let $p:=y+z$ and $q:=x+y+z$.

Since $p-z=y\ge 0$ and $q-p=x\ge 0$, we can see that the number of non-negative solutions to $x+2y+3z=42$ is equal to the number of non-negative solutions to $z+p+q=42$ with $\color{red}{z\le p\le q}$.

So, let us consider $z+p+q=42$ which has $\binom{42+3-1}{3-1}=946$ non-negative solutions. (see here)

  • The number of solutions satisfying $z=p=q$ is $1$.

  • If $z=p$, then we have $2p+q=42$. Since $q$ has to be even, letting $q=2q'$, we have $p+q'=21$. So, there are $22$ solutions. Since this include the solution satisfying $z=p=q$, the number of solutions such that only two of $z,p,q$ are equal is $3\times (22-1)=63$.

  • The number of solutions such that $z,p,q$ are distinct is $946-1-63=882$.

Therefore, the number of non-negative solutions to $z+p+q=42$ with $z\le p\le q$ is given by $$1+21+\frac{882}{3!}=\color{red}{169}$$

mathlove
  • 151,597