I'm new to matrix multiplication and was trying to generate a sequence of consecutive numbers from the product of two $2 \times 2$ matrices and noticed this pattern. Let
$$ A = \begin{pmatrix} n & n+1 \\ n+2 & n-1 \end{pmatrix}, \quad B = \begin{pmatrix} m & m-1 \\ m-1 & m \end{pmatrix}, \quad C = AB $$
Compute
\begin{align*} C &= \begin{pmatrix} n & n+1 \\ n+2 & n-1 \end{pmatrix} \begin{pmatrix} m & m-1 \\ m-1 & m \end{pmatrix} \\ &= \begin{pmatrix} nm + (n+1)(m-1) & n(m-1) + (n+1)m \\ (n+2)m + (n-1)(m-1) & (n+2)(m-1) + (n-1)m \end{pmatrix} \\ &= \begin{pmatrix} 2nm - n + m - 1 & 2nm + m - n \\ 2nm + m - n + 1 & 2nm + m - n - 2 \end{pmatrix} \end{align*}
Let $k = 2nm + m - n$, then
$$ C = \begin{pmatrix} k - 1 & k \\ k + 1 & k - 2 \end{pmatrix} $$
which yields consecutive numbers $k-2,k-1,k,k+1$.
Example
Let $n=150, m=16$. Then multiplying
$$ \begin{pmatrix} 150 & 151 \\ 152 & 149 \\ \end{pmatrix} \cdot \begin{pmatrix} 16 & 15 \\ 15 & 16 \\ \end{pmatrix} = \begin{pmatrix} 4665 & 4666 \\ 4667 & 4664 \\ \end{pmatrix} $$
gives $k=4666$ with consecutive numbers $4664, 4665, 4666, 4667$. WolframAlpha
Questions
Can that method be generalized to two $n \times n$ matrix products, resulting in $n^2$ consecutive numbers?
Aside, is there a way to ensure the $n^2$ consecutive numbers are always composite?