Given a finite collection of matrices, it is natural to consider the average determinant of a matrix in such a collection. For example, an interesting problem involving the average determinant of a binary matrix is given in the following link: Fun Linear Algebra Problems.
So it is natural to consider the average determinant of a matrix in $M_{k}(R)$, the full ring of $k \times k$ matrices over a finite ring $R$. In particular, I am interested in the average determinant of a matrix in $M_{2}(\mathbb{Z} / n \mathbb{Z})$ using the 'usual' operations of addition and division, i.e. the arithmetic mean of $\{ \det(A) : A \in M_{2}(\mathbb{Z} / n \mathbb{Z}) \}$ with respect to the 'usual' operations of addition and division. Letting $a_{n}$ denote the arithmetic mean of this set, we have that:
$$\left( a_{n} : n \in \mathbb{N}_{\geq 2} \right) = \left( \frac{3}{8}, \frac{8}{9}, \frac{21}{16}, \frac{48}{25}, \frac{161}{72}, \frac{144}{49}, \frac{105}{32}, \frac{104}{27}, \frac{171}{40}, \frac{600}{121}, \ldots \right).$$
The On-Line Encyclopedia of Integer Sequences (OEIS) does not 'recognize' the sequence $$\left( 3, 8, 21, 48, 161, 144, 105, 104, 171, 600, \ldots \right)$$ of numerators of $\left( a_{n} : n \in \mathbb{N}_{\geq 2} \right)$, and the sequence of denominators of $\left( a_{n} : n \in \mathbb{N}_{\geq 2} \right)$ is not currently in the OEIS. It appears that the sequence $$\left( a_{n} \cdot 2 n^2 : n \in \mathbb{N}_{\geq 2} \right) = \left( 3, 16, 42, 96, 161, 288, 420, 624, 855, \ldots \right)$$ is an integer sequence, but this sequence is not currently in the OEIS. However, it appears that the sequence $$\left( \left\lfloor a_{n} \right\rfloor : n \in \mathbb{N}_{\geq 2} \right) = \left( 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, \ldots \right)$$ is equal to the OEIS sequence A004526.
It is natural to ask:
(1) What is $a_{n}$? Can the sequence $\left( a_{n} : n \in \mathbb{N}_{\geq 2} \right)$ be expressed in a natural way in terms of 'well-known' integer sequences? Is there a simple combinatorial/number-theoretic formula for $a_{n}$ which may be used to compute $a_{n}$ more efficiently compared to a brute-force algorithm for computing $a_{n}$?
(2) Is there a simple way of proving that $\left\lfloor a_{n} \right\rfloor = \left\lfloor \frac{n-2}{2} \right\rfloor$? Is there a simple way of generalizing this result?
(3) Are there any interesting number-theoretic or combinatorial properties associated with the average determinant or immanant of a matrix in $M_{k}(\mathbb{Z} / n \mathbb{Z})$?