TITLE: Does $\det\left[\left(\frac{i^2-\frac{p-1}2!\,j}p\right)\right]_{1\le i,j\le(p-1)/2}$ vanish for every prime $p\equiv3\pmod 4$?
QUESTION [10 upvotes]: For any odd prime $p$, let $D_p$ denote the determinant
$$\det\left[\left(\frac{i^2-\frac{p-1}2!\times j}p\right)\right]_{1\le i,j\le (p-1)/2},$$
where $(\frac{\cdot}p)$ is the Legendre symbol. Then
\begin{gather*}D_3=0,\ D_5=-1,\ D_7=D_{11}=0,\ D_{13}=-8,
\\ D_{17}=-72,\ D_{19}=D_{23}=0,\ D_{29}=-2061248.\end{gather*}
QUESTION: Let $p$ be an odd prime. Is it true that $D_p=0$ if and only if $p\equiv 3\pmod4$?
In 2013 I formulated this problem and conjectured that the answer is yes. I have verified this for all primes $p<2300$. By a result of L. Mordell [Amer. Math. Monthly 68(1965), 145-146], for any prime $p>3$ with $p\equiv3\pmod4$ we have
$$\frac{p-1}2!\equiv(-1)^{(h(-p)+1)/2}\pmod p,$$
where $h(-p)$ is the class number of the imaginary quadratic field $\mathbb Q(\sqrt{-p})$.
Any ideas towards the solution?

REPLY [7 votes]: Warning: this is mod $p$ answer only. Thus it answers the original question for $p=4k+1$ but $p=4k+3$ remains open.
Denote $\alpha=-(\frac{p-1}2)!$ and apply the formula given by Darij Grinberg in the comment here https://mathoverflow.net/a/302143/4312
where $n=(p-1)/2$, $x_j=\alpha\cdot j$, $y_j=j^2$ for $j=1,\dots,n$. Note that all elementary symmetric polynomials $e_k$, $1\leqslant k\leqslant n-1$, for $y$'s are equal to 0 (mod $p$ of course), since they are coefficeints of a polynomial $(t^2-1^2)(t^2-2^2)\dots (t^2-n^2)=t^{p-1}-1$. Thus only two summands remain: $e_0(x)e_n(y)$ and $e_n(x)e_0(y)$. They go with the same (and non-zero) coefficient, thus $p$ divides your determinant if and only if $p$ divides $e_n(x)+e_n(y)=\prod x_i+\prod y_i=-\alpha^{n+1}+\alpha^2=\alpha^2(\alpha^{n-1}-1)$. We have $\alpha^2=(-1)^{n+1}$ (from above polynomial or from Wilson theorem). If $p=4k+3$, $n=2k+1$, this gives $\alpha^2=1$ and indeed  $\alpha^{n-1}-1=0$. If $p=4k+1$, $n=2k$, this gives $\alpha^2=-1$ and $\alpha^{n-1}=\alpha^{2k-1}=\pm \alpha\ne 1$.