Problem
Suppose I have $3\times3$ matrix $A$ with distinct values: $$ A \in \{B \in \mathbb{N}^{3\times3} | (i,j) \neq (k,l) \implies b_{ij} \neq b_{kl}\} $$ Which also satisfies: $$ (A \times \begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix}) \in \{n^2|n\in\mathbb{N}\}^{3\times3} $$ Meaning that the sum of any two values in a row is a perfect square.
And also: $$ (A \times J_{3,1}) \in \{mJ_{3,1}|m\in\mathbb{N}\} $$ Meaning, the sum of each row is the same.
So I want to find cardinality of the set of all possible matrices A. And if not finite, then I want to find the corresponding aleph number and parameterize matrix A.
My attempt
One way I thought might be possible is to try to parameterize: $$ x_{11}^2 + x_{12}^2 + x_{13}^2 = x_{21}^2 + x_{22}^2 + x_{23}^2 = x_{31}^2 + x_{32}^2 + x_{33}^2 = 2m $$
And given that: $$ x_{i1} < x_{i2} < x_{i3}, \\ x_{i1}^2 + x_{i2}^2 > x_{i3}^2, \\ x_{i1}^2 + x_{i2}^2 + x_{i3}^2 \mod 2 \equiv 0 $$ Then I can find: $$ a_{i1} = \frac{1}{2}(x_{i1}^2 + x_{i2}^2 - x_{i3}^2) \\ a_{i2} = \frac{1}{2}(x_{i3}^2 + x_{i1}^2 - x_{i2}^2) \\ a_{i3} = \frac{1}{2}(x_{i2}^2 + x_{i3}^2 - x_{i1}^2) $$ And the sum will $m$. But if I understand it correctly, values of $A$ in that case might not be distinct.