Under what conditions does $(\frac{3}{p})(\frac{-1}{p})=1?$ Two ways, different results. I have quite a problem, two methods, different results. something's wrong.
I'm trying to find under what conditions the Legendre symbol for $(\frac{3}{p})(\frac{-1}{p})=1$.
First Way: $(\frac{3}{p})(\frac{-1}{p})=(\frac{3}{p})\cdot(-1)^{(p-1)/2}$.
For $p\equiv1\pmod4$, I get that $(\frac{3}{p})=(\frac{p}{3})$ and it is $1$ iff $p\equiv1\pmod3$ and $p\equiv1\pmod4$. Otherwise I get that $(\frac{3}{p})=-(\frac{p}{3})$ so it has to be that $p\equiv1\pmod3$, in order to get $-1\cdot -1 \cdot 1=1$. The Chinese remainder theorem tells me that the $p\equiv1,7 \pmod{12}$.
Second way (I believe that it is the problematic one but yet I can't see what's wrong):
$$\left(\frac{3}{p}\right)\left(\frac{-1}{p}\right)=\left(\frac{3}{p}\right)\cdot(-1)^{(p-1)/2}=\left(\frac{p}{3}\right)(-1)^{((p-1)/2)\cdot((3-1)/2)}\cdot(-1)^{(p-1)/2}=\left(\frac{p}{3}\right),$$ this equals $1$ only for $p \equiv 1 \pmod 3$.
What's wrong with the second way? I believe it's all legal.
Thanks a lot!
 A: Nothing's wrong.  The answer is that for a prime $p > 3$, $\left( \frac{3}{p} \right) \left( \frac{-1}{p} \right) = 1 \iff p \equiv 1 \pmod 3$.  Note that the possible residue classes modulo $12$ for a prime $p > 3$ are the ones which are coprime to $12$, i.e., $1,5,7,11$.  Of these the ones congruent to $1$ modulo $3$ are $1$ and $7$.
Let me give you yet a third way to solve this problem.  For an odd prime $p$, set $p^* = (-1)^{\frac{p-1}{2}} p$.  Then an equivalent statement of quadratic reciprocity is that for distinct odd primes $p,q$,
$\left( \frac{p}{q} \right) = \left( \frac{q^*}{p} \right)$.
(Admittedly, verifying this is similar in nature to what you're doing!  The point though is that this is a formula worth proving and then remembering.)
Applying this with $q = 3$, we get $\left( \frac{3}{p} \right) \left( \frac{-1}{p} \right) = \left( \frac{-3}{p} \right) = \left(\frac{p}{3} \right)$, which is $1$ iff $p \equiv 1 \pmod{3}$. 
A: They are the same thing: $p\equiv 1, 7\pmod {12}$ is the same as $p\equiv 1\pmod 3$ when $p$ is prime.  That's because $p\equiv 4,10\pmod {12}$ is not possible when $p$ is prime.
