Show that these matrices are invertible for all $p>3$ I am working on a paper which will extend a result in my thesis and have boiled one problem down to the following: show that the symmetric matrix $M_p$, whose definition follows, is invertible for all odd primes $p$. Letting $p>3$ be prime and $\ell = \frac{p-1}{2}$, we define
$$M_p = \begin{pmatrix} 2ij - p - 2p\left\lfloor\frac{ij}{p}\right\rfloor\end{pmatrix}_{1\leq i,j\leq \ell}$$
Examples:

*

*For $p=5$ we have $M_5 = \begin{pmatrix} -3 & -1 \\ -1 & 3 \end{pmatrix}$ and $\det(M_5) = -1\cdot 2\cdot 5$.


*For $p=7$ we have $M_7 = \begin{pmatrix} -5 & -3 & -1 \\ -3 & 1 & 5 \\ -1 & 5 & -3 \end{pmatrix}$ and $\det(M_7) = 2^2 \cdot 7^2$.


*For $p=11$ we have $M_{11} = 
\begin{pmatrix} 
-9 & - 7 & -5 & -3 & -1 \\
-7 & -3 & 1 & 5 & 9 \\
-5 & 1 & 7 & -9 & -3 \\
-3 & 5 & -9 & -1 & 7 \\
-1 & 9 & -3 & 7 & -5
\end{pmatrix}$ and
$\det(M_{11}) = -1\cdot 2^4\cdot 11^4$.
Though this (seemingly) nice formula that we see above fails for primes greater than 19, though the determinant has been checked to be non-zero for primes less than 1100. (My apologies if this question is not as motivated or as well discussed as is desired. If there are any questions or if further clarification is needed just let me know!)

Experimentally, we have the following formula for $p$ prime:
$$\det(M_p)=(-1)^{(p^2-1)/8}(2p)^{(p-3)/2}h_p^-\;,$$
where $h_p^-$ is the minus part of the class number of the $p$-th cyclotomic
field, itself essentially equal to a product of $\chi$-Bernoulli numbers.
I have not tried to prove this, but since there are many determinant
formulas for $h_p^-$ in the literature, it should be possible.
