A $n \times n$ linear system Solve the linear system
$
\begin{array}{ c c c c c c c c c c c c c c }
 &  & x_{2} & + & x_{3} & + & \dotsc  & + & x_{n-1} & + & x_{n} & = & 2 & \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ( 1)\\
x_{1} &  &  & + & x_{3} & + & \dotsc  & + & x_{n-1} & + & x_{n} & = & 4 & \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ( 2)\\
x_{1} & + & x_{2} &  &  & + & \dotsc  & + & x_{n-1} & + & x_{n} & = & 6 & \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ( 3)\\
\vdots  &  & \vdots  &  & \vdots  &  & \ddots  &  & \vdots  &  & \vdots  &  & \vdots  & \ \ \ \ \ \ \ \ \ \ \ \\
x_{1} & + & x_{2} & + & x_{3} & + & \dotsc  & + & x_{n-1} &  &  & = & 2n & \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ( n)
\end{array}
$

Attempt
I am not confident yet with my linear algebra, so I tried approaching this problem by adding all of the equations, which gives us
$
\begin{align*}
(n-1)(x_1+x_2+x_3+\ldots+x_{n-1}+x_n)=2+4+6+\ldots+2n \tag*{}
\end{align*}
$
since $x_i$ ($i \in \mathbb{N}, i \leq n$) always appear in every equation except the $i$-th equation. The right-hand side is the sum of first $n$ positive even number, which can be simplified further as
$
\begin{align*}
(n-1)(x_1+x_2+x_3+\ldots+x_{n-1}+x_n) &= n(n+1)
\\[.5em]
x_1+x_2+x_3+\ldots+x_{n-1}+x_n &= \dfrac{n(n+1)}{n-1} \tag*{}
\end{align*}
$
Subtracting respectively Eq. (1), Eq. (2), up to Eq. (n) from Eq. (A), gives us
$
\begin{align*}
x_1 &= \dfrac{n(n+1)}{n-1} - 2 = \dfrac{n(n+1) - 2(n-1)}{n-1} = \dfrac{n^2 - n + 2}{n-1} \tag*{}\\
x_2 &= \dfrac{n(n+1)}{n-1} - 4 = \dfrac{n(n+1) - 4(n-1)}{n-1} = \dfrac{n^2 - 3n + 4}{n-1} \\
\vdots \\
x_n &= \dfrac{n(n+1)}{n-1} - 2n = \dfrac{n(n+1) - 2n(n-1)}{n-1} = \dfrac{3n-n^2}{n-1} 
\end{align*}
$

However, I'm rather concerned with the denominator ($n-1$) which causes division by zero when $n = 1$. Did I do a mistake, or maybe did I misunderstand something in the process? And what would be the correct approach to this problem? Thanks.


Note: I found the problem here.

Let $A_n\in M_n(K)$ be the matrix with $0$ on the diagonal and entry $1$ everywhere else. Then $\det(A)\neq 0$ for $n\ge 2$. In fact, there is an easy formula for the determinant on this site, namely $\det(A)=(-1)^{n-1}\cdot (n-1)$, see here:
Determinant of a matrix with diagonal entries $a$ and off-diagonal entries $b$
The system then is given by $Ax=b$ with $b=(2,4,\ldots ,2n)^T$. The unique solution is given by
$$
x=A^{-1}b,
$$
because $Ax=b$ gives $x=A^{-1}Ax=A^{-1}b$. One can also find an explicit formula for the inverse of $A$, and thus obtain an explicit solution (which you can also derive directly from the equations).
