Determinants concerning Legendre symbols

The evaluations of determinants with Legendre symbol entries have close relation with character sums over finite fields. Recently, Sun posed some conjectures on this topic. In this paper, we prove some conjectures of Sun and also study some variants. For example, we show the following result: Let $p=a^2+4b^2$ be a prime with $a,b$ integers and $a\equiv1\pmod4$. Then for the determinant $$S(1,p):={\rm det}\bigg[\left(\frac{i^2+j^2}{p}\right)\bigg]_{1\le i,j\le \frac{p-1}{2}},$$ the number $S(1,p)/a$ is an integral square, which confirms a conjecture posed by Cohen, Sun and Vsemirnov.


Introduction
Given an n × n complex matrix M = [a i j ] 1≤i , j ≤n , we often use det M or |M | to denote the determinant of M .The evaluation of determinants with Legendre symbol entries is a classical topic in number theory, combinatorics and finite fields.Krattenthaler's survey papers [7,8] introduce many concrete examples and advanced techniques on determinant calculation.
Let p be an odd prime and let • p denote the Legendre symbol.Carlitz [2] studied the following (p − 1) × (p − 1) matrix He obtained that the characteristic polynomial of D p is precisely , where I p−1 is the (p − 1) × (p − 1) identity matrix.Along this line, Chapman [3] further investigated the following matrices: and , where x is a variable.In the case p ≡ 1 (mod 4), let ε p > 1 and h(p) be the fundamental unit and class number of the real quadratic field Q( p) respectively and let ε and that Moreover, Chapman [4] posed a conjecture concerning the determinant of the Due to the difficulty of the evaluation on this determinant, he called it "evil" determinant.Finally this conjecture was confirmed completely by Vsemirnov [11,12].Recently Sun [9] studied various determinants of matrices involving Legendre symbol entries.Let p be a prime and d be an integer with p d .Sun defined In the same paper, Sun also studied some properties of the above determinant.For example, he showed that −S(d , p) is always a quadratic residue modulo p if ( d p ) = 1 and that S(d , p) = 0 if d p = −1.Moreover, Sun posed the following conjecture: Conjecture 1 (Sun).Let p ≡ 3 (mod 4) be a prime.Then −S(1, p) is an integral square.
This conjecture was later confirmed by Alekseyev and Krachun by using some algebraic number theory.In the case p ≡ 1 (mod 4), Cohen, Sun and Vsemirnov also posed the following conjecture.
As the first result of this paper, by considering some character sums over finite fields, we confirm this conjecture and obtain the following result.For convenience, for each d ∈ Z we set

653
As an application of Theorem 3, we confirm this conjecture.

Proofs of the main results
We begin with the following permutation involving quadratic residues (readers may refer to [5,10] for details on the recent progress on permutations over finite fields).

(mod p).
This implies the desired result.
We also need the following known result concerning eigenvalues of a matrix.

Lemma 7.
Let M be an m × m complex matrix.Let µ 1 , . . ., µ m be complex numbers, and let u 1 , . . ., u m be m-dimensional column vectors.Suppose that M u k = µ k u k for each 1 ≤ k ≤ m and that u 1 , . . ., u m are linear independent.Then µ 1 , . . ., µ m are exactly all the eigenvalues of M (counting multiplicities).
Before the proof of Theorem 3, we first introduce some notation.In the remaining part of this section, we let p = a 2 +4b 2 be a prime with a, b ∈ Z and a ≡ 1 (mod 4), and let n = p−1 2 .In addition, we let χ(Z/pZ) denote the group of all multiplicative characters on the finite field Z/pZ = F p , and let χ p be a generator of χ(Z/pZ), i.e., χ(Z/pZ) = {χ k p : k = 1, 2, . . ., p − 1}.Readers may refer to [6,Chapter 8] for a detailed introduction to characters on finite fields.Also, given any matrix M , the symbol M T denotes the transpose of M .Now we are in a position to prove our first theorem.
Proof of Theorem 3. Throughout this proof, we define We first determine all the eigenvalues of M p .For k = 1, 2, . . ., n, we let We claim that λ 1 , . . ., λ n are exactly all the eigenvalues of M p (counting multiplicities).In fact, for any 1 ≤ i , k ≤ n we have This implies that for each k = 1, . . ., n, we have where the vectors v 1 , . . ., v n are linear independent.By Lemma 7 our claim holds.Hence we have Now we turn to the last product.When k = n, by [6, Chapter 5, Exercise 8] we have When k = n/2, by [1, Theorem 6.2.9] we have As M p is a real symmetric matrix, every eigenvalue λ k of M p is real.Hence for any 1 ≤ k ≤ We now prove our next result.The last equality follows from (5).Now our desired result follows from Theorem 3.
λ k = λ n−k .Let f (x) := det(x I n − M p )be the characteristic polynomial of M p .By the above we observe that all roots of f (x) apart from λ n = −1 and λ n/2 = −a are of even multiplicity.Using unique factorisation in Z[x], one can obtain that f (x) = (x + 1)(x + a)g (x) 2 ,where g (x) is a polynomial with integer coefficients.Therefore we obtain that S(1, p)/a = g (0) 2 is an integral square.Now we consider S(d , p).If p | d , then clearly S(d , p) = 0.If d p = −1, then by [9, Theorem 1.2] we know that S(d , p) = 0. Suppose now that d is a quadratic residue modulo p. Then clearly we have S(d , p) = sgn(π p (d ))S(1, p).Now our desired result follows from Lemma 6.
and d is not a biquadratic residue modulo p, 1 otherwise .
p (d )) be the sign of π p (d ).We first have the following result: Lemma 6.Let p ≡ 1 (mod 4) be a prime, and let d ∈ Z be a quadratic residue modulo p. Thensgn(π p (d )) = 1 if d is a biquadratic residue modulo p, −1 otherwise .Proof.It is clear that sgn(π p (d )) ≡ 1≤i < j ≤n d j 2 − d i 2 j 2 − i 2 (mod p).