How would you solve $a_{1}+...a_{m}=0$ given that $a_{i}\in\mathbb{Z}$, $|a_{i}|<k$ and if $a_{i}=a$, then $a_{j}\neq a$

34 Views Asked by At

We are looking for integer solutions to the following equation for different values of $m$. $$a_{1}+a_{2}+...+a_{m}=0$$ Where we have conditions on the numbers. $\forall i, j$, if $a_{i}=a$ then $a_{j}\neq -a$. So if an integer is used then its additive inverse cannot be used. Also all values of $a_{i}$ must lie in some range, $|a_{I}|<k$.

I have been specifically looking at when $k=4$ (my actual problem, I just generalised for the post) and have come up with the following solutions via basically trial and error.

$m=1 \Longrightarrow$ No solutions as $0=-0$

$m=2 \Longrightarrow$ No solutions

$m=3 \Longrightarrow$ $(-2,1,1)$, $(-3, 1, 2)$ (and also the same solutions where all numbers are multiplied by $-1$, but I do not care for these duplicates)

$m=4 \Longrightarrow$ $(-1,-1,-1,3)$, $(-2,-2,1,3)$

How can I determine solutions for higher values of $m$ and different values of $k$ without a computer search?

1

There are 1 best solutions below

1
On

You can recycle what you have already found: $(2,-1,-1)$ and $(-1,-1,-1,3)$ will give you a solution for any $m\geq6$, by writing $m$ as $3a+4b$ for some non-negative $a$ and $b$. This is for $k=4$ and therefore any $k\geq 4$.

e.g. $m=10=4+3+3$ gives $(-1,-1,-1,3,\ \ 2,-1,-1,\ \ 2,-1,-1)$ .

For $m=5$ you have $(3,3,-2,-2,-2)$.