For the access function developed in Example 5.10(d), the matrix \(A=\left(a_{i
j}\right)_{m \times n}\) was stored in a one-dimensional array using the row
major implementation. It is also possible to store this matrix using the
column major implementation, where each entry \(a_{11}, 1 \leq i \leq m\), in
the first column of \(A\) is stored in locations \(1,2,3, \ldots, m\),
respectively, of the array, when \(a_{11}\) is stored in location 1. Then the
entries \(a_{12}, 1 \leq i \leq m\), of the second column of \(A\) are stored in
locations \(m+1, m+2, m+3, \ldots, 2 m\), respectively, of the array, and so on.
Find a formula for the access function \(g\left(a_{i j}\right)\) under these
conditions.