# How to use Bars and Stars method for equations with more than 1 non unity coefficients?

I know we can find the non negative integral solutions of the equation $$x+y+z=24$$ using Bars and Stars method. The same can be extended to provide the solutions for equations like $$2x+y+z = 24$$.

But is there any way to find the non negative integral solutions of

$$3x + 2y + z = 24$$

and subsequently a generalised formula of non negative integral solutions of

$$nx + py + qz = k$$ where $$n,p,q>1$$?

• Jul 28, 2020 at 11:35
• I assume you meant to write nonnegative integral solutions rather than non integral solutions. Jul 28, 2020 at 11:48

I don't have an exact solution, but since the $$d$$-simplex $$\sum_{i=1}^da_ix_i\le k$$ has volume $$k^d/(d!\prod_ia_i)$$ for $$a_i,\,k\ge0$$, $$\sum_{i=1}^da_ix_i=k$$ should have $$\sim k^{d-1}/((d-1)!\prod_ia_i)$$ solutions.
• @NoahJ.Standerson For large $a_i,\,k,\,d$, it probably won't round to the exact value.
• @NoahJ.Standerson The fractional error will be $O(1/k)$, but it's hard to be more detailed than that.