# Matrix with integer entries, first row as $(1~2~3~\cdots~n)$, and determinant $k$

Let $n\ge2$ be an integer. Given an integer $k$ does there exist an $n\times n$ matrix $A$ with integer entries such that $\mathrm{det}(A)=k$ and the first row of $A$ is $(1~2~3~\cdots~n)$?

As much as I could think, we can always obtain the other rows of $A$ by Gram Schmidt orthogonalization starting with the given row, hence getting an orthogonal matrix with determinant $1$, but this matrix doesn't have integer entries.

• It's enough to solve the problem for $k=1$, since then you can get all other $k$'s by multiplying the second row by $k$. – darij grinberg May 4 '18 at 5:56
• For $k=1$, it is a particular case of a well-known fact: math.stackexchange.com/questions/1833917/… – darij grinberg May 4 '18 at 5:57
• We can make it so that the bottom $n\times m$ matrix consists of a $0$ column and the identity matrix, that has determinant $1$. – Jorge Fernández-Hidalgo May 4 '18 at 6:03

You can set the first row to be $(1, \dots n)$ as desired. Then, fill every other row except the last one with $1$s in the diagonal, and $k$ is the lower-right corner where we place $k$. This matrix will be upper triangular, and since the diagonal consists of $n-1$ ones and one copy of $k$, it will have determinant $k$.

Formally, consider the upper triangular matrix $M \in \mathbb{R}^{n\times n}$ defined by: $M_{1j} = j,$ $M_{ij} = \delta_{ij} \$ if $1 < i < n$, and $M_{nj} = k\delta_{nj}$. This matrix verifies that its first row is $(1 \dots n)$, and is upper triangular with $1$s in the diagonal except for the lower-right corner, in which $M_{nn} = k$. Therefore,

$$\det(M) = \prod_{i=0}^n M_{ii} = k$$

• I think its faster to say, take any upper triangular matrix such that the diagonal contains $n-1$ ones and one $k$. A good answer by the way. – Jorge Fernández-Hidalgo May 4 '18 at 6:05
• I agree, this formulation is partly due to the fact that I'm not used to writing matrices in $\LaTeX$. I'm editing to add the intuitive idea. Thanks. – guidoar May 4 '18 at 6:07

Consider the matrix such that $a_{i,j}=$:

• $j$ if $i=1$
• $0$ if $i> 1$ and $j=0$
• $k$ if $i=2$ and $j=2$
• $1$ if $i=j$ and $i\geq 3$
• $0$ if $i>1$ and $j>1$ and $i\neq j$

If we calculate the determinant by iterating over the first row you only get one non-zero summand and it is $1\times k$

Perhaps an example is clear? For $n = 4$, consider the matrix $$M = \begin{pmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & k \end{pmatrix}$$ Since the determinant of an upper-triangular matrix is the product of the diagonal elements, we are done.