Consider systems of three linear equations with unknowns $x$, $y$, and $z$,
\begin{align*} a_1 x + b_1 y + c_1 z & = 0 \\ a_2 x + b_2 y + c_2 z & = 0 \\ a_3 x + b_3 y + c_3 z & = 0 \end{align*}
where each of the coefficients is either $0$ or $1$ and the system has a solution other than $x=y=z=0$.
For example, one such system is \[\{ 1x + 1y + 0z = 0, 0x + 1y + 1z = 0, 0x + 0y + 0z = 0 \}\]
with a nonzero solution of $\{x,y,z\} = \{1, -1, 1\}$. How many such systems of equations are there?
(The equations in a system need not be distinct, and two systems containing the same equations in a
different order are considered different.)
$\textbf{(A)}\ 302 \qquad\textbf{(B)}\ 338 \qquad\textbf{(C)}\ 340 \qquad\textbf{(D)}\ 343 \qquad\textbf{(E)}\ 344$
Let $M_1=\begin{bmatrix}a_1 & b_1 & c_1\end{bmatrix}, M_2=\begin{bmatrix}a_2 & b_2 & c_2\end{bmatrix},$ and $M_3=\begin{bmatrix}a_3 & b_3 & c_3\end{bmatrix}.$
We wish to count the ordered triples $(M_1,M_2,M_3)$ of row matrices. We perform casework:


$M_1=M_2=M_3.$
There are $2^3=8$ options for $M_1.$ Once $M_1$ is chosen, $M_2$ and $M_3$ are uniquely determined. 
In this case, we have $\boldsymbol{8}$ ordered triples $\boldsymbol{(M_1,M_2,M_3).}$
Exactly two of $M_1,M_2,$ and $M_3$ are equal.
For $M_1=M_2\neq M_3,$ there are $2^3=8$ options for $M_1.$ Once $M_1$ is chosen, $M_2$ is uniquely determined, and $M_3$ has $2^3-1=7$ options. So, there are $8\cdot7=56$ ordered triples $(M_1,M_2,M_3).$
Similarly, for each of $M_1=M_3\neq M_2$ and $M_2=M_3\neq M_1,$ there are $56$ ordered triples $(M_1,M_2,M_3).$
In this case, we have $\boldsymbol{56\cdot3=168}$ ordered triples $\boldsymbol{(M_1,M_2,M_3).}$
All of $M_1,M_2,$ and $M_3$ are different.
There are two subcases: 

Exactly one of $M_1,M_2,$ and $M_3$ is $\begin{bmatrix}0 & 0 & 0\end{bmatrix}.$
For $M_1=\begin{bmatrix}0 & 0 & 0\end{bmatrix},$ there are $2^3-1=7$ options for $M_2$ and $2^3-2=6$ options for $M_3.$ So, there are $7\cdot6=42$ ordered triples $(M_1,M_2,M_3).$
Similarly, for each of $M_2=\begin{bmatrix}0 & 0 & 0\end{bmatrix}$ and $M_3=\begin{bmatrix}0 & 0 & 0\end{bmatrix},$ there are $42$ ordered triples $(M_1,M_2,M_3).$
In this subcase, we have $\boldsymbol{42\cdot3=126}$ ordered triples $\boldsymbol{(M_1,M_2,M_3).}$
The sum of two of $M_1,M_2,$ and $M_3$ is equal to the third matrix.
For $M_1+M_2=M_3:$


If $M_1=\begin{bmatrix}1 & 0 & 0\end{bmatrix},$ then $M_2\in\{\begin{bmatrix}0 & 1 & 1\end{bmatrix},\begin{bmatrix}0 & 1 & 0\end{bmatrix},\begin{bmatrix}0 & 0 & 1\end{bmatrix}\}.$
More generally, if $M_1$ consists of one $1$ and two $0$'s, then $M_2$ has $3$ options, and $M_3$ is uniquely determined. So, there are $\binom31\cdot3=9$ ordered triples $(M_1,M_2,M_3).$
If $M_1=\begin{bmatrix}1 & 1 & 0\end{bmatrix},$ then $M_2=\begin{bmatrix}0 & 0 & 1\end{bmatrix}.$
More generally, if $M_1$ consists of two $1$'s and one $0,$ then $M_2$ and $M_3$ are uniquely determined. So, there are $\binom32=3$ ordered triples $(M_1,M_2,M_3).$


There are $9+3=12$ ordered triples $(M_1,M_2,M_3).$ 
Similarly, for each of $M_1+M_3=M_2$ and $M_2+M_3=M_1,$ there are $12$ ordered triples $(M_1,M_2,M_3).$
In this subcase, we have $\boldsymbol{12\cdot3=36}$ ordered triples $\boldsymbol{(M_1,M_2,M_3).}$


Together, the answer is $8+168+126+36=\boxed{\textbf{(B)}\ 338}.$
~MRENTHUSIASM