Procedures to find solution to $a_1x_1+\cdots+a_nx_n = 0$ Suppose that $x_1, \dots,x_n$ are given as an input. Then we want to find $a_1,\ldots,a_n$ that satisfy $a_1x_1 + a_2x_2+a_3x_3 + a_4x_4+\cdots +a_nx_n =0$. (including the case where such $a$ set does not exist.)
How does one find this easily? (So I am asking for an algorithm.)
Edit: all numbers are non-zero integers. 

You said "all numbers are non-zero integers". I assume that means each $x_i$ is a nonzero integer and you want a solution such that every $a_i$ is a nonzero integer.
If $n=1$, there is no solution.
If $n\ge2$, let $S=x_2+\ldots+x_n$. If $S\not=0$, then $(a_1,a_2,a_3,\,\ldots,\,a_n)=(-S, x_1, x_1, \ldots, x_1)$ is a solution; otherwise, $(-x_2,\, 2x_1,\, x_1, \ldots, x_1)$ is a solution.
