Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 4.1.12 (Expression for the least positive residue of $a$ modulo $m$)

Exercise 4.1.12 (Expression for the least positive residue of $a$ modulo $m$)

For any integers a and m 2 , prove that a m a m is the least non-negative residue of a modulo m . Write a similar expression for the least positive residue of a modulo m .

Answers

Proof.

(a)
The Euclidean division of a by m 2 gives a = qm + r , 0 r < m ,

where the remainder r is the least non-negative residue of a modulo m .

Then a m = q + r m , where 0 r m < 1 , thus q = a m and

r = a m a m

is the least non-negative residue of a modulo m .

(b)
We write a = q m + s , 0 < s m ,

where s is the least positive residue of a modulo m . Then a m = q + s m , where 0 < s m 1 . Thus

q < a m q + 1 , q 1 a m < q .

Therefore q 1 = a m , and q = 1 a m , so

s = a + m ( 1 + a m )

is the least positive residue of a modulo m .

Check:

sage: a, m = 143, 7
sage: a + m * (1 + floor(-a/m))
3
sage: a, m = 140, 7
sage: a + m * (1 + floor(-a/m))
7

User profile picture
2024-12-15 10:34
Comments