%% magic square
%% a b c
%% d e f
%% g h i
%%
%% rows, cols, diags sum to k
%% 8 eqtns in 9 unknowns
syms k
A=[1 1 1 0 0 0 0 0 0 k;
   0 0 0 1 1 1 0 0 0 k;
   0 0 0 0 0 0 1 1 1 k;
   1 0 0 1 0 0 1 0 0 k;
   0 1 0 0 1 0 0 1 0 k;
   0 0 1 0 0 1 0 0 1 k;
   1 0 0 0 1 0 0 0 1 k;
   0 0 1 0 1 0 1 0 0 k]
rref(A)
	
