Number Theory, Squares in $\mathbb{Z}_p ^*\,\;$ for odd prime $p$ Let $p$ be an odd prime and $\mathrm{gcd}(n, p) = 1.$ Assume that $n = p_1^{a_1} p_2^{a_2}  ... p_k ^{a_k}$ is the prime factorization of n. Prove
$$\left(\frac{n}{p}\right) = \left(\frac{p_1}{p}\right)^{i_1} \left(\frac{p_2}{p}\right)^{i_2} ... \left(\frac{p_k}{p}\right)^{i_k},$$ where $i_j = 1$ if $a_j$ is odd, and $i_j = 0$ if $a_j$ is even.
 A: Hint: The problem seems to be about the Legendre symbol, since the thing at the bottom is an odd prime. It could also be about the Jacobi symbol, since in this case the Legendre symbol and the Jacobi symbol coincide.
How one does it depends on the theorems already available. 
To reduce the exponents $a_j$ to the $i_j$, you can use the following fact:
Let $m$ and $p$ be relatively prime, and let $n=a^2 m$, where $a$ and $p$ are relatively prime. Then $n$ is a quadratic residue of $p$ if and only if $m$ is a quadratic residue of $p$. However, this fact is not really needed: see below.
You will also need the following fact: the product of two quadratic residues is a quadratic residue, as is the product of two quadratic non-residues. The product a a QR and a NR is a NR.
From this you can conclude that in general $(ab/p)=(a/p)(b/p)$. (I am using $(m/p)$ for the Legendre symbol.) From the product formula for two terms, one can see that 
$$(c_1c_2\cdots c_k/p)=(c_1/p)(c_2/p)\cdots(c_k/p).$$
That is very close to the formula you want to prove. 
Note that in particular, $(c^a/p)=(c/p)^a$. So $(c^a/p)=1$ if $a$ is even, and $(c^a/p)=(c/p)$ if $a$ is odd. 
