0

I used Fermat's Little Theorem to get

$x^2 \equiv x\pmod 2$

So $2k = x^2-x$ for some integer $k$

$= 2k = x(x-1)$, note that this is a product of two consecutive numbers, so we can rewrite it as $2l$ for some integer $l$

$ = 2k = 2l$

$= k = l$

I don't think this tells me anything meaningful. I think my wrong step is when I start to toy around with the product of consecutive integers, but I am not sure how else to proceed.

Bill Dubuque
  • 272,048
zzzzz
  • 119

1 Answers1

0

$x^2\equiv x\pmod {p}$ simply means that $p|x^2-x$, or $p|x(x-1)$.

Now since $(x,x-1)=1$, either $p|x$ or $p|x-1$, thus giving $x=kp$ or $x=kp+1$ as the only solutions $(k\in \mathbb Z)$.

  • thank you. stack exchange is telling me i can accept this as answer in 8 minutes and I will do so when I can – zzzzz Mar 06 '21 at 10:17
  • "Now since $(x,x−1)=1$, either $p|x$ or $p|x−1$", that part is not correct. The reason we can conclude $p$ divides one of the factors is that $p$ is prime, not that the factors are relatively prime. For example $6$ divides $3\cdot(3-1)$, but it clearly doesn't divide either of the factors. – sbares Mar 06 '21 at 10:22
  • @sbares isn't it established before that $p$ is a prime? Also, we can directly conclude from $(x,x-1)=1$ that either $p|x$ or $p|x-1$ because if $p$ divides both, then they both have a common factor, which is contradictory, and if p divides none, then $p\not |x(x-1)$ – Devansh Kamra Mar 06 '21 at 10:26
  • @DevanshKamra Since $p$ is prime, we don't even need that $(x, x-1) = 1$ to conclude that it divides one of them. We don't even need it to conclude that it doesn't divide both; all we need is that $x$ and $x-1$ are not congruent modulo $p$. – sbares Mar 06 '21 at 10:38