Irreducibility of polynomials related to quadratic residues Let $p \equiv 1 \bmod 4$ be a prime number. Define the polynomial
$$ f(x) = \sum_{a=1}^{p-1} \Big(\frac{a}{p}\Big) x^a. $$
Then $f(x) = x(1-x)^2(1+x)g(x)$ for some polynomial 
$g \in {\mathbb Z}[x]$ (this follows from elementary properties
of quadratic residues).
For $p = 5$, we have $g = 1$; for $p = 13$, we find 
$$ g(x) = x^8 + 2x^6 + 2x^5 + 3x^4 + 2x^3 + 2x^2 + 1. $$ 
pari tells me that the Galois group is "2^4 S(4)"
and has order $384 = 16 \cdot 24$.
My questions:


*

*Have these polynomials been studied anywhere? Since I did not just make them up, I am tempted to believe that they are natural enough to have shown up somewhere else.

*Is $g$ always irreducible? pari says it is for all p < 400.

 A: These are known as Fekete polynomials:
http://en.wikipedia.org/wiki/Fekete_polynomial .
I don't know of any results on their Galois groups.
A: Hi,
In Remark 2 of "Zeros of Fekete Polynomials", (http://arxiv.org/PS_cache/math/pdf/9906/9906214v1.pdf), Conrey et. al. give
$$\sup_{|z|=1}|f(z)| \ll p^{0.5} \log p.$$
But the Mahler measure of $f$, $M(f)$, is bounded from above by $\sup_{|z|=1}|f(z)|$. (I took this from (7.4) of "Experimental Number Theory" by F. R. Villegas.)
Since Mahler measure is multiplicative, then, letting
$$
f = \prod_i f_i
$$
where the product is over all irreducible factors, one has
$$
M(f) = \prod_i M(f_i).
$$
Using lower bounds for Mahler measures found in "The Mahler measure of Algebraic Numbers: A Survey" by C. Smyth,(http://www.maths.ed.ac.uk/~chris/Smyth240707.pdf), perhaps one can, comparing upper and lower bounds for Mahler measures, get a nontrivial upper bound on the number of irreducible factors of the Fekete polynomial? For example, (11) of the paper by Smyth gives, for the algebraic number $\alpha$ with minimal polynomial of degree $d \geq 2$,
$$
M(\alpha) > 1 + \frac{1}{1200}\left(\frac{\log \log d}{\log d}\right)^3.
$$
