Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 2.3.45* (Number of solutions of $x^2 \equiv x \pmod m$)

Exercise 2.3.45* (Number of solutions of $x^2 \equiv x \pmod m$)

Find the number of solutions of x 2 x ( mod m ) for any positive integer m .

Answers

Write N ( m ) the number of solutions of x 2 x ( m o d m ) . We first determine N ( m ) if m = p α is a power of a prime p ( α 1 ).

Then

x 2 x ( m o d p α ) p α x ( x 1 ) .

Since x and x 1 are relatively prime,

p α x ( x 1 ) p α x  or  p α x 1 ,

because p u x , with u > 0 and p v x 1 , with v > 0 ( u + v = α ) imply p x ( x 1 ) = 1 : this is impossible.

Therefore

x 2 x ( m o d p α ) x 0 ( mod p α )  or  x 1 ( mod p α ) . (1)

This gives N ( p α ) = 2 .

Now let m be an integer greater than 1 , and m = p 1 a 1 p k a k its decomposition in prime factors. Then, using (1),

x 2 x ( m o d m ) x ( x 1 ) 0 ( m o d p 1 a 1 ) , , x ( x 1 ) 0 ( mod p k a k ) ( x 0  or  x 1 ( m o d p 1 α 1 ) )  and   and  ( x 0  or  x 1 ( mod p k α k ) )

So x 2 x ( m o d m ) if and only if x is a simultaneous solution of one of the 2 k systems of congruences

{ x η 1 ( m o d p 1 α 1 ) , x η 2 ( m o d p 2 α 2 ) , x η k ( m o d p k α k ) ,

where ( η 1 , η 2 , , η k ) { 0 , 1 } k . The Chinese Remainder Theorem shows that these systems have exactly one solution modulo m = p 1 a 1 p k a k . Since there are 2 k such system, N ( m ) = 2 k where k is the number of prime divisors of m .

The number of solutions of x 2 x ( m o d m ) is 2 k , where k is the number of prime divisors of m .

I checked this result with a Python program, up to m = 2 5 0 . The maximum is for m = 2 1 0 = 2 3 5 7 , for which x 2 x ( m o d 2 1 0 ) has 1 6 solutions.

User profile picture
2024-08-17 17:43
Comments