Hi this is my first post and this is a problem that has bothered me a lot.
Suppose we have the $2012\times2012$ square matrix:
$\begin{bmatrix}-3&1&1&1&1&1&\ldots&1&1&1&1\\1&2&1&1&1&1&\ldots&1&1&1&1\\1&1&-3&1&1&1&\ldots&1&1&1&1\\1&1&1&2&1&1&\ldots&1&1&1&1\\1&1&1&1&-3&1&\ldots&1&1&1&1\\1&1&1&1&1&2&\ldots&1&1&1&1\\\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\ldots&\vdots&\vdots&\vdots&\vdots\\1&1&1&1&1&1&\ldots&-3&1&1&1\\1&1&1&1&1&1&\ldots&1&2&1&1\\1&1&1&1&1&1&\ldots&1&1&-3&1\\1&1&1&1&1&1&\ldots&1&1&1&2\end{bmatrix}$
How can I write it using Mathematica? Of course I need to define something like a function which will assign elements to the positions of the matrix.