I'm trying to create an n*n matrix that would follow this criteria
1 2 3 ... n
n+1 n+2 n+3 ... 2n
2n+1 2n+2 2n+3 ... 3n
. .
. .
. .
(n-1)n+1 ........ n^2
How would I be able to create this matrix using a table or a do loop? This is what I've created so far, but it doesn't follow the criteria unfortunately.
n = Input["What positive integer would you like to start your matrix with?"];
x = ConstantArray[0, {n, n}];
Do[x[[i, j]] = i + j, {i, 1, n}, {j, 1, n}]
x // MatrixForm
Partition[Range[n^2], n]
? $\endgroup$