Solve a system of equations of ten unknowns. I have the following problem:
Find all $a_1,a_2,a_3,....,a_{10} \in\{1,2,3,...,10\}$ satisfying 
$\hspace{2cm}\begin{align} a_1+a_2+a_3 &=k\\ a_3+a_4+a_5 &=k\\
a_5+a_6+a_7 &=k\\
 a_7+a_8+a_1 &=k \\
a_1+a_9+a_5 &=k \\
 a_7+a_{10}+a_3 &=k
\end{align} $ 
where $k$ is a constant positive integer.
I am really stuck on this problem how to solve these $6$ equations to find the ten unknowns.Please help me.
Thanks.
 A: There's 25420 solutions, for various k between 3 and 30. Definitely not the most elegant, but my way is to enumerate them all with a program. Following is a C program that does it.
void enumerate() {
int k, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;

for (k = 3; k <= 30; k++) {
    for (a1 = 1; a1 <= 10; a1++)
        for (a2 = 1; a2 <= 10; a2++) {
            a3 = k - a2 - a1;
            if (a3 > 0 && a3 <= 10)
                for (a4 = 1; a4 <= 10; a4++) {
                    a5 = k - a3 - a4;
                    if (a5 > 0 && a5 <= 10)
                        for (a6 = 1; a6 <= 10; a6++) {
                            a7 = k - a5 - a6;
                            a8 = k - a7 - a1;
                            a9 = k - a5 - a1;
                            a10 = k - a7 - a3;
                            if ((a7 > 0 && a7 <= 10) && (a8 > 0 && a8 <= 10)
                                    && (a9 > 0 && a9 <= 10)
                                    && (a10 > 0 && a10 <= 10)) {
                                cout << "a1 " << a1 << ", a2 " << a2
                                        << ", a3 " << a3 << ", a4 " << a4
                                        << ", a5 " << a5 << ", ";
                                cout << "a6 " << a6 << ", a7 " << a7
                                        << ", a8 " << a8 << ", a9 " << a9
                                        << ", a10 " << a10 << ", ";
                                cout << "k " << k << endl;
} } } } } }

A: we need to deal with two cases: $k \neq 0$ and $k = 0$. i will first deal with the case $k \neq 0.$ i will set $k = 1.$ once i find a particular solution i will multiply all of them by $k.$ this is the matrix i get when i rrefed. i will indicate the columns $7$ through $11.$ previous $6$ columns is $I_6$
$\pmatrix{1&1&0&0&1\\-1&-1&0&0&0\\1&0&0&1&1\\0&1&-1&-1&0\\-1&-1&1&0&0\\2&1&-1&0&1}$
the variables $a_1, a_2, \cdots, a_6$ are pivot variables and rest are free variables. for a particular solution set all the free variables to zero. the pivot variables are then the negative of column $11.$ a basis for the the homogeneous solution is gotten by e.g. set $a_7 = 1, a_8 = \cdots = a_{10} = 0$ then pivot variables are then the negative of column $7$. 
i hope you can take it from here.
