A conjecture on primitive tenth roots of unity QUESTION. How to solve my following conjecture involving primitive tenth roots of unity?
Conjecture. Let $\zeta$ be any primitive tenth root of unity. Then
$$\prod_{k=1}^{(p-1)/2}(\zeta-e^{2\pi ik^2/p})=(-1)^{|\{1\le k\le\frac {p+9}{10}:\ (\frac kp)=-1\}|}$$
for each prime $p\equiv21\pmod{40}$, and
$$\prod_{k=1}^{(p-1)/2}(\zeta-e^{2\pi ik^2/p})=(-1)^{
|\{1\le k\le\frac {p+1}{10}:\ (\frac kp)=-1\}|}\zeta^2$$
for any prime $p\equiv29\pmod{40}$, where $(\frac kp)$ is the Legendre symbol.
Remark. The conjecture was motivated by Questions 337879 and 338876 on MathOverflow, and I have checked it numerically via Mathematica. For related materials, see Conjectures 5.4 and 5.5 of my preprint arXiv:1908.02155.
 A: Not a complete solution.
Let $p$ be (1 mod 4) and  $r,n$ runs over quadratic residues/non residues mod $p$ in $[1,p-1]$ and let
$R_p(x)=\prod_r(x-\zeta_p^r),\;\;\; N_p(x)=\prod_n(x-\zeta_p^n).$ 
It is known (see for example, Daveport's Multiplicative number theory, p.19),
that $R_p(x)=[Y_p(x)-\sqrt{p}Z_p(x)]/2,  \;\; N_p(x)=[Y_p(x)+\sqrt{p}Z_p(x)]/2$
where $Y_p(x),Z_p(x) \in \mathbb{Z}[x]$, so $Z_p(x)=[N_p(x)-R_p(x)]/\sqrt{p}$ and 
$N_p(x)R_p(x)=(x^p-1)/(x-1)$. 
If one compute a few terms of $Z_p(x)$, one can discover  
immediately that $Z_p(x)$ is divisible by the 10th cyclotomic polynomial $\Phi_{10}(x)$
if and only if $p=21, 29$ mod 40. This explain why one gets nice result as conjectured only for
these two congruence classes. Assuming this, (we are still missing a  proof that $N_p(\eta)=R_p(\eta)$),
it will follow that for any primitive 10th root of unity $\eta$,
$R_p(\eta)^2=R_p(\eta)N_p(\eta)=(\eta^p-1)/(\eta-1)$, so
$R_p(\eta)=\pm 1$ if $p$ is (21 mod 40), and $R_p(\eta)=\pm \eta^2$ if $p$ is (29 mod 40).
It remains to determine the sign. This is reminiscent of the determination of the sign of the Gauss's sum.
We now observe that the very useful trick of writing 
$(1-e^{i\theta})=(e^{-i \theta/2}-e^{i \theta/2})e^{i \theta/2}=(-2i)\sin( \theta/2) e^{i \theta/2}$
can be extended to the case of two roots of unity, namely
$R_p(\zeta_m^a)=\prod_r(\zeta_m^a-\zeta_p^r)(\zeta_m^{-a/2}\zeta_p^{-r/2})\prod_r(\zeta_m^{a/2}\zeta_p^{r/2}) $
$= \zeta_m^{a(p-1)/4}\zeta_p^{-p(p-1)/8}(2i)^{(p-1)/2} \prod_r \sin \pi (\frac{a}{m}-\frac{r}{p}). $
Now set $m=10,a=1,p=40k+21$, we get
$R_p(\zeta_{10})=(-1)2^{(p-1)/2} \prod_r \sin \pi (\frac{p-10r}{10p}).$
Clearly $-1 < \frac{p-10r}{10p}<1$, so the number of negative $\sin$ factors in the product is the number of $r$ with
$r>p/10$ which equals 
$(p-1)/2- \#\{1 \le r \le p/10\}=(p-1)/2-\#\{1 \le r \le (p+9)/10\},$ 
since $c=(p+9)/10$ is always a non residue mod $p$ as $10c=9$ mod 10 is  a residue
while 10 is nonresidue. So the number of negative $\sin$ factors  is 
$(p-1)/2-( (p+9)/10-\#\{n : n \le (p+9)/10 \})$.
Since $1+(p-1)/2-(p+9)/10$ is even for $p=40k+21$, $R_p(\zeta_{10})=(-1)^{\#\{n : 1 \le n \le (p+9)/10 \}}$.   
Now $Y_p(x)=x^{(p-1)/4}W(x+1/x)$, since $Y(x)$ is known to be reciprocal,
we have $2R_p(\zeta_{10})=Y_p(\zeta_{10})=Y_p(\zeta_{10}^9)$. 
Similarly, we have $R_p(\zeta_{10}^3)=R_p(\zeta_{10}^7)$. We still need to show
$R_p(\zeta^3)=R_p(\zeta)$.
The case for $p=29$ mod 40 is similar.
(Added) The congruence condition $p=21,29$ mod 40 is determined by $-1$ and $5$ are quadratic residue while $2$ is a non residue. The sign depends on whether $5$ is a quartic residue mod $p$, ie $5^{(p-1)/4} = \pm 1$ mod $p$.
