Legendre symbol, product of primes So, it's the question:

I solve it by assuming $d$ is a prime number.
My question is: Why I can assume that? 
I wrote $d$ as a product of primes ($d$=$p_1$$p_2$...$p_r$), therefore $(\frac{d}{p})$ = $\prod_{i=1}^r$ $(\frac{p_i}{p})$.  How to continue?
Thanks 
 A: We can assume $d$ is prime. If it wasn't, then write $d=(±1)2^a p_{1}^{a_1}p_{2}^{a_2}...p_{r}^{a_r}$, and so $(\frac{p_{k}^{a_k}}{p}) = (\frac{p_k p_k ... p_k}{p})= (\frac{p_{k}}{p})(\frac{p_{k}}{p})...(\frac{p_{k}}{p})$. We could consider the case for $d=(±1)$ or $d=2^a$ separately as well. So, without loss of generality, assume $d$ is prime:


*

*$p=4m+1 \Rightarrow p≡1 \mod 4$ (since $4m=p-1 \Rightarrow 4|p-1 \Rightarrow p≡1 \mod 4$).

*$d|m \Rightarrow kd=m$ for some integer $k$.

*Quadratic reciprocity: $(\frac{p}{q})(\frac{q}{p}) = 1$ if $p≡1 \mod 4$ or $q≡1 \mod 4$.
Notice that $(\frac{d}{p})(\frac{p}{d})=1$ since $p≡1 \mod 4$. So either $(\frac{d}{p})$ and $(\frac{p}{d})$ are both $1$ or $-1$; i.e., $\color{blue}{(\frac{d}{p}) = (\frac{p}{d})}$.
Write $p=4m+1$, and so $p=4(kd) + 1 = (4k)d + 1$, so $(4k)d = p-1$, so $d|p-1$, so $p≡1 \mod d$ and so $1≡p \mod d$ (congruence modulo $n$ is reflexive).
Ask yourself: is $x^2 ≡ p \mod d$ solvable? Surely it is; $x=1$ is a solution! So $(\frac{p}{d}) = 1$. By quadratic reciprocity $(\frac{d}{p}) = (\frac{p}{d}) = 1$, so $(\frac{d}{p}) = 1$.
