Approach to solving for all variables (whole numbers) in this linear and quadratic equation?

30 Views Asked by At

Suppose of I have the following setup:

$$a + b + c... = m$$ $$a^2 + b^2 + c^2... = n$$ $$0 < a < b < c ... < l $$

Where $m,n,l$ are known constants and there are an arbitrary number of whole numbers $a,b,c...$ to solve for. Is there an approach to finding a closed form solution for these variables in this system of equations?

I'm fairly certain the solutions are unique.

1

There are 1 best solutions below

0
On BEST ANSWER

Switch to "gap variables". Your inequality $$ 0 < a < b < c < \cdots < l $$ is a little awkward because we imagine the labels $a$, $b$, $c$, ..., $l$ jostling back and forth on the number line, but never passing each other. It is better to make your variables more independent.

Set the new, primed variables as follows and replace the old unprimed variables as indicated. \begin{align*} b' &= b - a & b &\mapsto a+b' \\ c' &= c - b & c &\mapsto a+b'+c' \\ &\vdots \\ l' &= l - k & l &\mapsto a+b'+c'+\cdots+l' \\ \end{align*} and we have the inequalities $0 < a$, $0 < b'$, $0 < c'$, ..., $0 < l'$.

Choosing $b' = c' = \cdots = l' = 1$ in the first two equations gives "a multiple of $a$" is $m+1$ minus the number of variables. This gives an upper bound on $a$. The quadratic equation gives another upper bound on $a$. For each choice of $a$ from $1$ to the lesser of these two upper bounds, we get a similar system in the variables $b'$, $c'$, ..., $l'$, which we reduce in the same way.

You start with an interval for $a$. For each choice of $a$, you get an interval for $b'$. For each choice of $(a,b')$ you get an interval for $c'$ and so on. By inspection, you can write formulas for these intervals in terms of the preceding variables. These formulas are generically piecewise to capture the shift from tight constraint by the linear equation and tight constraint by the quadratic equation. Attempting to write these formulas in general is not a great use of anyone's time.