# Suppose $p$ is an odd prime and there exists some integer $x$ such that $x^2 \equiv -1 \pmod{p}$. Prove that $p \equiv 1 \pmod{4}$. [closed]

Suppose $p$ is an odd prime and there exists some integer $x$ such that $x^2 \equiv -1 \pmod{p}$. Prove that $p \equiv 1 \pmod{4}$. Use Fermat's Theorem.

## closed as off-topic by ThePortakal, Henrik, Foobaz John, Vidyanshu Mishra, kingW3Oct 1 '17 at 19:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – ThePortakal, Henrik, Foobaz John, Vidyanshu Mishra, kingW3
If this question can be reworded to fit the rules in the help center, please edit the question.

$\mathbb{F}_p^{\times}$ is cyclic of order $p-1$ (even). So by Fermat-Lagrange result we have that for every elements : $x^{p-1}\equiv 1 \pmod p$.

Morover with the hypothesis we have the fact that $x$ has order $4$. Indeed $x^4\equiv 1 \pmod p$. So $4 \mid p-1$.

Let's call the order of $x$ to be the smallest positive integer power, $k$ so that $x^k \equiv 1 \mod p$. We'll denote the order of $x$ as $|x|$.... (assuming some a power exists; which it won't if $x$ is not relatively prime to $p$.)

Clearly $x^{k|x| + j; 0 \le j < |x|} = (x^{|x|})^k*x^j \equiv 1^k*x^j\equiv x^j \mod p$ and furthermore $x^{m} \equiv 1 \mod p \iff m \equiv 0 \mod |x|$

.....

Okay we know 1) $x^2 \equiv -1\mod p$.

And 2) Fermat's Theorem: $x^{p-1} \equiv 1 \mod p$.

For 1) It is easy to verify $|x| = 4$. [$*$].

So 2) implies $p-1 \equiv 0 \mod 4$.

======

[$*$]If the order of $x$ were $1$ then $x\equiv 1\mod p \implies x^2 \equiv 1\not \equiv -1 \mod p$.
If the order of $x$ were $3$ then $1 \equiv x^3 = x*x^2 \equiv -x \mod p\implies x\equiv -1 \mod p \implies x^2 \equiv 1 \mod p$. And, of course $x^4 \equiv 1 \mod p$. [Note; this assumes $p > 2$ so $1 \not \equiv -1 \mod p$]

Your answer is in theorem $2.12$. Just exclude $p=2$ as you said odd primes.

• Source: Niven, Zukerman, Montgomery- An introduction to theory of numbers.