How many integer solutions there are for this equation $\sum_{k=1}^r |x_k| =n$?

105 Views Asked by At

Using a proper generating function I need to evaluate the number of integer solutions to this equation : $\sum_{k=1}^r |x_k| =n$

Can I assume that

$\sum_{k=1}^r x_k =n$

and

$\sum_{k=1}^r -x_k =n$

has the same amount of integer solutions and that the answer is actually $2*p$

for p equals the number of integer solutions to the following equation $\sum_{k=1}^r x_k =n$ ?

2

There are 2 best solutions below

2
On

If $r=2$, then $(0,n)$ for natural numbers becomes two solutions $(0,\pm n)$, but $(m,n-m)$ becomes four solutions $(\pm m,\pm(n-m))$

0
On

For $r=1$ the generating function for the number of solutions is $$1+2x+2x^2+\dots=\frac{1+x}{1-x}$$ as every value of $n\ne0$ has two possible solutions namely $x_1=\pm n$ with the same absolute values and $n=0$ has only one solution namely $x_1=0$. Then, for $r\ge1$, it follows that the generating function for the number of solutions is $$(1+2x+2x^2+\dots)^r=\left(\frac{1+x}{1-x}\right)^r$$ as each tuple of absolute values $(|x_1|,\dots,|x_r|)$ which produces a valid solution corresponds to a number of tuples of $r$ integers $(x_1,\dots,x_r)$ given by multiplying the coefficients of the monomials in each bracket with the powers $|x_1|,\dots,|x_r|$ respectively.