TITLE: Checkboard matrix, brand new or old?
QUESTION [24 upvotes]: Ok so what I found was a square matrix of order $n×n$ where $n$ follows $2m+1$ and $m$ is a natural number
the pattern these matrices follow is as follows:
for a $3×3$ matrix:
$$ A = \left( \begin{array}{ccc}
b & a & c \\
a & a+b+c & a \\
c & a & b \end{array} \right)$$
and the cool thing is that
$$ A^x = \left( \begin{array}{ccc}
q & p & r \\
p & p+q+r & p \\
r & p & q \end{array} \right)$$
where $ x $ is any natural number
Now for $5×5$ it goes like
$$ A = \left( \begin{array}{ccc}
b & b & a & c & c\\
b & b & a & c & c\\
a & a & 2b+a+2c & a & a\\
c & c & a & b & b\\
c & c & a & b & b\end{array} \right)$$
and again
$$ A^x = \left( \begin{array}{ccc}
q & q & p & r & r\\
q & q & p & r & r\\
p & p & 2q+p+2r & p & p\\
r & r & p & q & q\\
r & r & p & q & q\end{array} \right)$$
Once more for a $7×7$ matrix we have
$$ A = \left( \begin{array}{ccc}
b & b & b & a & c & c & c\\
b & b & b & a & c & c & c\\
b & b & b & a & c & c & c\\
a & a & a & 3b+a+3c & a & a & a\\
c & c & c & a & b & b & b\\
c & c & c & a & b & b & b\\
c & c & c & a & b & b & b\\
\end{array} \right)$$
and then 
$$ A^x = \left( \begin{array}{ccc}
q & q & q & p & r & r & r\\
q & q & q & p & r & r & r\\
q & q & q & p & r & r & r\\
p & p & p & 3q+p+3r & p & p & p\\
r & r & r & p & q & q & q\\
r & r & r & p & q & q & q\\
r & r & r & p & q & q & q\\
\end{array} \right)$$
and so on and so forth, I didn't find whether this has already been observed and neither a name for this so I am calling this checkboard matrix, because it looks like that.
I just have one question, has this been found already, if yes please give details.
Addendum: Thanks to Robert Israel for pointing out the error,  I have made some changes,  please check into it.  The pattern for the middle element is $ m (b+c)+a $

REPLY [9 votes]: For the $3 \times 3$ case, you have the commutative ring (with identity) generated by $\pmatrix{0 & 1 & 0\cr 1 & 0 & 1\cr 0 & 1 & 0\cr}$.  For the $2n+1 \times 2n+1$ case with $n > 1$, you could take the commutative ring (without identity) generated by
the block matrices $\pmatrix{0_{n,n} & 0_{n,1} & 1_{n,n}\cr 0_{1,n} & n & 0_{1,n}\cr 1_{n,n} & 0_{n,1} & 0_{n,n}\cr}$ and
$\pmatrix{0_{n,n} & 1_{n,1} & 0_{n,n}\cr 1_{1,n} & 0 & 1_{1,n}\cr 0_{n,n} & 1_{n,1} & 0_{n,n}\cr}$ (where the blocks are of sizes $n$, $1$ and $n$, and $0_{i,j}$ or $1_{i,j}$ denotes an $i \times j$ block filled with $0$'s or $1$'s). 
EDIT: This gives you matrices of the form
$$\pmatrix{a \; 1_{n,n} & b \; 1_{n,1} & c\; 1_{n,n} \cr b \; 1_{1,n} & n(a+b) & b \; 1_{1,n}\cr c\; 1_{n,n} & b \; 1_{n,1} & a\; 1_{n,n}\cr}$$