Let $S$ be the set containing all $3 \times 3$ matrices with entries from $\{-1, 0, 1\}$. The total number of matrices $A \in S$ such that the sum of all the diagonal elements of $A^TA$ is 6 is ______ .
Numerical-value question: the answer is a number.
Show answer
The answer is 5376.
Key from source paper