Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 4.1.31 (if $m = \sum_i a_i d^i$ with $0 \leq a_i < d$, then $a_i = \lfloor m/d^{i-1} \rfloor - d \lfloor m/d^i\rfloor$)

Exercise 4.1.31 (if $m = \sum_i a_i d^i$ with $0 \leq a_i < d$, then $a_i = \lfloor m/d^{i-1} \rfloor - d \lfloor m/d^i\rfloor$)

Let the positive integer m be written in the base d , so that m = i a i d i with 0 a i < d for all i . Prove that a i = m d i 1 d m d i .

Note: It seems that there is a typo. We must read a i = m d i d m d i + 1 (note of R.G.).

Answers

Proof. The positive integer m = j = 0 n a j d j can be written for every i [ [ 0 , n ] ] under the form

m = a n d n + + a i d i + + a 0 = ( a n d n i + + a i + 1 d + a i ) d i + ( a i 1 d i 1 + + a 0 ) = q d i + r ,

where

r = a i 1 d i 1 + + a 0 ( d 1 ) ( d i 1 + d i 2 + + 1 ) = d i 1 .

Therefore q , r are the quotient and remainder in the division of m by d i , so (by Problem 12)

m d i = a n d n i + + a i + 1 d + a i . (1)

Similarly, if i < n , replacing i by i + 1 , m d i + 1 = a n d n i 1 + + a i + 1 , so

d m d i + 1 = a n d n i + + a i + 1 d . (2)

Then equations (1) and (2) give

m d i d m d i + 1 = a i , i = 0 , 1 , , n 1 .

(This remains true if i = n : then m d n + 1 = 0 and a n = m d n .) □

User profile picture
2025-01-04 11:46
Comments