I know that, for the $n = 2$ case with $\gcd(a_1, a_2)=1$, the only solutions to $a_1 x_1 + a_2 x_2 = 0$ are $x_1 = a_2 t$ and $x_2 = -a_1 t$, for $t \in \mathbb{Z}$.
I'm trying to understand what the solutions to the general equation $\sum_{i=1}^n a_i x_i = 0$ look like, subject to $\gcd(a_1,\dots,a_n)=1$.
Can they also be expressed as a function of the $a_i$'s and some integer $t$? (Or integers $t_i$?)
If it makes it easier, one can assume that the $a_i$'s are $> 0$ and can be partitioned into pairs $(a_i,a_j)$ such that $\gcd(a_i, a_j) = 1$ for all such pairs. For example, for $n=4$, set $(\color{red}{a_1}, \color{blue}{a_2}, \color{blue}{a_3}, \color{red}{a_4}) = (\color{red}{p_1 p_2}, \color{blue}{p_1 q_2}, \color{blue}{q_1 p_2}, \color{red}{q_1 q_2})$ and partition as $(\color{red}{a_1, a_4})$ and $(\color{blue}{a_2, a_3})$. (In general, it is not the case that $\gcd(a_i, a_j) = 1,\forall i,j$.)
For example, for the $n=3$ case and without the assumption above, (I believe) all solutions are of the form: \begin{align} x_1 &= c_{1,2} \cdot a_2/\gcd(a_1, a_2) - c_{1,3} \cdot a_3 / \gcd(a_1,a_3)\\ x_2 &= - c_{1,2} \cdot a_1/\gcd(a_1, a_2) + c_{2,3} \cdot a_3 / \gcd(a_2,a_3)\\ x_3 &= c_{1,3} \cdot a_1/\gcd(a_1, a_3) - c_{2,3} \cdot a_2 / \gcd(a_2,a_3)\\ \end{align} for integers $c_{1,2}, c_{1,3}, c_{2,3}$. (This is according to my understanding from [1; Chapter 6.2])
Can this be generalized for arbitrary $n$ as follows? $$x_i = \sum_{\substack{j=1\\j\ne i}}^n (-1)^{f(i,j)} c_{i,j} \cdot a_j / \gcd(a_i, a_j)$$ For some $f(i,j)$.