# A number is square in F_p for every prime p [duplicate]

Possible Duplicate:
Proving that an integer is the $n$ th power

Let $n$ be a natural number, if $n$ is a square in $\mathbb{F}_p$ for every prime $p$, is $n$ also a square in $\mathbb{Z}$ ?

Thanks

-

## marked as duplicate by Gerry Myerson, Qiaochu YuanNov 9 '11 at 4:59

Yes. Consider the extension $\mathbb{Q}(\sqrt{n})/\mathbb{Q}.$ As the polynomial $x^2 - n$ factors in $\mathbb{F}_p$ for every prime $p,$ we have $p$ splits in $\mathcal{O}_{\mathbb{Q}(\sqrt{n})}$ for almost all primes $p$. It follows by the Chebotarev density theorem, $\mathbb{Q}(\sqrt{n}) = \mathbb{Q}.$ Hence, $n$ is a square in $\mathbb{Z}.$
Note that $n$ only needed to be square mod $p$ for some set of primes of density greater than $1/2$ in order to conclude $n$ was a square in $\mathbb{Z}.$