Suppose we have $A \in M_3(\Bbb N\cup\{0\})$ s.t. sum of the elements of each row is $k $ for some fixed $k\in \Bbb N\cup\{0\}$. What are all the possibilities of $A$ s.t. $\det(A)=k$?
We can start from
- $k=0$ here we have to have the matrix to be zero.
- For $k=2$, I am getting $$ \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \\ \end{pmatrix} $$ as one such matrix then what are the other possibilities and can you give me a general question.
- Then what about $k=1,3$
And so on for any $k$ can we give a general structure?
Then this question can be extended to $A\in M_4(\Bbb N \cup{0})$.
By the way, what I want is if someone can give me some of the partial answers as the general answer might be too strong to expect!
This answer is not complete, but it reduces the problem to finding all triangles of area $\frac12$ with nonnegative integer coefficients that lie within $x+y\leq k$ (within the 2-simplex with edges of length $k$).
Let $$A=\begin{bmatrix}a&b&c \\ d&e&f \\ g&h&i\end{bmatrix}$$ with all the entries in $\{0,1,\ldots,k\}$. The conditions being imposed are:
Using the first three equations to eliminate $c,f,i$, the fourth equation gives: $$ (k-a-b)(dh-eg)+(k-d-e)(gb-ah)+(k-g-h)(ae-bd)=k $$
Expanding the products, many terms annihilate each other. For example $(-a)(dh)$ from the first product and $(-d)(-ah)$ from the second. It leaves:
$$ \begin{align} k(dh-eg)+k(gb-ah)+k(ae-bd)&=k\\ dh-eg+gb-ah+ae-bd&=1\\ \det\begin{bmatrix}d-a&e-b\\g-a&h-b\end{bmatrix}&=1\\ \text{twice the area of }\triangle(a,b)(d,e)(g,h)&=1 \end{align} $$
where the vector edges of the triangle, $\langle d-a,e-b\rangle$ and $\langle g-a,h-b\rangle$ are oriented counterclockwise.
This means that for every triangle in $\mathbb{R}^2$ with vertices in $\{0,1,\ldots,k\}^2$, where the vertices satisfy $x+y\leq k$, and the area of the triangle is $\frac{1}{2}$, and for each choice of orientation for $(a,b),(d,e),(g,h)$, we get a matrix of the prescribed form.
For example, when $k=7$, one such triangle is $(5,1)(4,2)(0,5)$ (a counterclockwise traversal). So we may take $a=5,b=1,d=4,e=2,g=0,h=5$. Then we recall this means $c=k-a-b=1$, $f=k-d-e=1$, $i=k=g=h=2$. And this matrix works:
$$A=\begin{bmatrix}5&1&1 \\ 4&2&1 \\ 0&5&2\end{bmatrix}$$
(Check that its rows sum to $7$ and its determinant is $7$.)
For $k=1$, there is only one such triangle, with vertices $(0,0)$, $(1,0)$, and $(0,1)$. There are three ways to identify the points $(a,b)$, $(d,e)$, $(g,h)$, giving rise to three matrices $\begin{bmatrix}1&0&0 \\ 0&1&0 \\ 0&0&1\end{bmatrix}$, $\begin{bmatrix}0&1&0 \\ 0&0&1 \\ 1&0&0\end{bmatrix}$, $\begin{bmatrix}0&0&1 \\ 1&0&0 \\ 0&1&0\end{bmatrix}$.
For $k=2$, I think I count $10$ such triangles, leading to $30$ such matrices.
For $k=3$, I count $35$. I may have made a mistake, but I think I have an exhaustive enumeration that calculates the count as $2(3^2+2^2+1^2+4\cdot2+3\cdot1)-(3\cdot4+3)=35$. Each has three orientations, so this would make $105$ such matrices.
For $k=4$, I count $88$, but I grow less certain my counting method is accurate.
I'd conjecture that this geometric equivalence generalizes. For the $n\times n$ version of the problem, look for all $n$-sets of points (the triangles in the $n=3$ case) within the $(n-1)$-simplex of edge length $k$, where the [hyper]volume encased by the $n$-set of points is $\frac{1}{(n-1)!}$ (the smallest possible nonzero [hyper]volume for such a thing). Each such $n$-set has $\frac{1}{2}n!$ positive orientations for enumerating the elements of the set. Each such $n$-set along with one of its positive orientations provides you with the first $n-1$ columns of a matrix, and the last column is determined by the requirement that rows sum to $k$.
The conjecture is verified for $n=2,3$. And it even works in a vacuous sense for $n=1$.
Maybe someone has studied how to count/enumerate/identify/parametrize all such $n$-sets. However for $n=3$, based on my counts above, I would expect either $\{1,10,35,88\}$ or $\{3,30,105,264\}$ to appear in the OEIS if this has been studied. But neither sequence appears.