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 and , prove that is the least non-negative residue of modulo . Write a similar expression for the least positive residue of modulo .
Answers
Proof.
- (a)
-
The Euclidean division of
by
gives
where the remainder is the least non-negative residue of modulo .
Then , where , thus and
is the least non-negative residue of modulo .
- (b)
-
We write
where is the least positive residue of modulo . Then , where . Thus
Therefore , and , so
is the least positive residue of modulo .
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