Page 1 of 1

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

Posted: Sat Jun 10, 2017 11:52 pm
by dshasan
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)\]

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

Posted: Thu Jun 22, 2017 6:51 am
by ahmedittihad
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 $.