0

Find number of solutions for equation: $~x+y+z=n~$ where $~x,~y,~z~$ are non-negative whole numbers and $~x\le y\le z~$.

First I used substitution $~y=x+k,~ z=y+k~$ where $~k\ge 0~$(that is $y=x+k, z=x+2k$). Then after I plug that into equation I got, $~3x+3k=n~$. Then after using generating functions I get $~(1-t^3)^{-2}~$ or $~\sum\limits_{n\ge 0}{n+1\choose n} t^{3n}~$. Is this correct?

RobPratt
  • 45,619
Trevor
  • 533

1 Answers1

1

The number $S(n)$ of solutions are $$S(n)=\frac{1}{72} \left(6 n^2+36 n+9 (-1)^n+16 \cos \left(\frac{2 \pi n}{3}\right)+47\right)$$ and its generating function is $$F(x)=\frac{1}{(1-x)^3 (x+1) \left(x^2+x+1\right)}=\frac{1}{(1-x) \left(1-x^2\right) \left(1-x^3\right)}$$ first values, starting from $n=0$, are $$0,1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 19, 21, 24, 27, 30, 33, 37, 40,\ldots$$

Raffaele
  • 26,371