While explaining how to invert matrices I once used this ill-fated example $A=\begin{pmatrix} 1&2&3\\4&5&6 \\7&8&9 \end{pmatrix}$ which can not be inverted ($\det(A)=0$). That got me thinking, given a matrix of size $N$, what are some good functions that map to the elements such that:
- The elements are integers
- The elements are "small" (for hand calculation)
- The matrix is always invertible
- (optional) the function has a random component, but still satisfies (3)
Let $A_{ij} = f(j + (i-1)N)$. In the example above $f(n) = n$.