1

Given four integer values $a,b,m,n \gt 0$, I know how to compute the number of positive integer solutions of the following equation:

$$x+y+z=n$$

and also the number of positive integer solutions of this one:

$$x+ay+bz=m$$

(see for example this question).

My question: is it possible to find a formula for the number of positive integer solutions of the below system, without assigning specific values to $a,b,m,n$?

$$\begin{cases} x+y+z=n \\ x+ay+bz=m \\ \end{cases} $$

I tried some simple manipulation like e.g. subtracting the two equations to get $(a-1)y+(b-1)z=m-n$, however clearly the number of solutions for that still isn't the same for the system.

EDIT

I just found an answer to a similar question here. Using the same technique, the number of solutions should be the coefficient of $s^nt^m$ for the generating function:

$$\frac{1}{(1-st)(1-st^a)(1-st^b)}$$

However, I think that it's impossible to compute it without choosing values for $a,b,n,m$.

  • I think substracting the equations should work. For every pair of $y,z$ that solve $(a-1)y+(b-1)z=m-n$ there is exactly one value of $x$ that satisfies the original system of equations. As $y,z,n$ are integers so is $x$, so you only have to check whether $x$ is positive. – quarague Aug 14 '19 at 10:46
  • @quarague this would work for a specific choice of $a,b,n,m$ where I can enumerate and test each solution to see whether $x > 0$, but I would like to get a general formula, although probably quite difficult, if possible. – Fabius Wiesner Aug 14 '19 at 11:28

1 Answers1

1

Consider first the case $a=b$: $$\begin{cases} y+z &=&n-x \\ a(y+z)&=&m-x \\ \end{cases}$$ Then solutions can only exist if $m-x = a(n-x)$, i.e. $x = \frac{an-m}{a-1}$. In the case that $\frac{an-m}{a-1}$ is a positive integer, this reduces to solving $y+z = n-\frac{an-m}{a-1} = \frac{m-n}{a-1}$ using the techniques you already know.


Now, if $a \neq b$ then without loss of generality we can say $a > b$, since the equations are symmetric under the substitution $(a \leftrightarrow b, y \leftrightarrow z)$. For any given value of $x$ there is exactly one pair $(y,z)$ which satisfies the equations, and the question is whether it's a pair of two positive integers.

$$ y = \frac{m-bn+(b-1)x}{a-b} \\ z = \frac{an-(a-1)x-m}{a-b} \\ $$

So we require $$ m-bn+(b-1)x \equiv an-(a-1)x-m \equiv 0 \pmod{a-b} \\ m-bn+(b-1)x > 0 \\ an-(a-1)x-m > 0 $$

which with a bit of manipulation reduces to

$$ (b-1)x \equiv bn-m \pmod{a-b} \\ \frac{bn-m}{b-1} < x < \frac{an-m}{a-1} $$

Now, $\gcd(b-1, a-b) = \gcd(b-1, a-1)$ is not necessarily trivial, and when it's non-trivial the number of solutions of $(b-1)x \equiv R \pmod{a-b}$ has a sensitive dependency on the divisibility of $R$ by the GCD.

Given $a,b,m,n$ it would be straightforward to compute the range of $x$ permitted by the inequalities, and (from that GCD) the valid equivalence classes for $x$, and then to calculate the intersection of the two sets. But don't expect a legible closed expression.

Peter Taylor
  • 13,425