Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 1.3.6 ($n = 2^rm$, where $m$ is odd)
Exercise 1.3.6 ($n = 2^rm$, where $m$ is odd)
Show that every positive integer has a unique expression of the form , a positive odd integer.
Answers
Proof. Let be a positive integer. Consider the subset of defined by
- since .
-
is bounded above. Indeed, if , then , thus , so .
This shows that every element of is less than , so is an upper bound for .
Since is bounded above, has a largest element
By definition of a largest element, , so . Thus there is some such that .
Assume for contradiction that is even. Then , thus , and . Then . This is absurd, therefore is odd.
Now we prove the unicity of this expression of . If , where are odd, then , and , thus , so . Similarly , therefore . From , we deduce . The expression is unique. □
Note: Alternatively, we can use the full decomposition in prime numbers of . Then , and is the product of for odd . From a computational point of view, the above solution is preferable. It suggests the following algorithm to obtain :
def niven136(n): r = 0 m = n while m % 2 == 0: r = r + 1 m = m // 2 return (r,m) print(niven136(3328)) (8, 13)