$x^2 \equiv x (mod n)$

For discussing Olympiad Level Number Theory problems
dshasan
Posts:66
Joined:Fri Aug 14, 2015 6:32 pm
Location:Dhaka,Bangladesh
$x^2 \equiv x (mod n)$

Unread post by dshasan » Sat Jun 10, 2017 11:52 pm

Let $n$ be a positive integer. Determine, in terms of n, the number of $x$ such that $x \in {1,2,...n}$ and \[x^2 \equiv x(mod n)\]
The study of mathematics, like the Nile, begins in minuteness but ends in magnificence.

- Charles Caleb Colton

User avatar
ahmedittihad
Posts:181
Joined:Mon Mar 28, 2016 6:21 pm

Re: $x^2 \equiv x (mod n)$

Unread post by ahmedittihad » Thu Jun 22, 2017 6:51 am

If we denote $f(n)$ the desired number, then CRT implies $f(mn)=f(m)f(n)$ whenever $(m;n)=1$.
So it suffices to find $f(n)$ when $n$ is a prime power.
It's quite trivial that there are $2$ solutions for $x $ if $n $ is a prime power. So, the answer is $2^z $ where $z $ is the number of distinct primes in the prime factorization of $n $.
Frankly, my dear, I don't give a damn.

Post Reply