0

Show that any natural number $n$ can be written on the form $n = 2^k \cdot m$, where $m$ is an odd integer and $k \geq 0$.

I know that if $n$ is an integer, it can be written on the form $n = \frac{a}{b}$ for two integers $a$ and $b$. Also, $m$ can be written as $m = 2c +1$ for an integer c, since it's odd. But I don't know how to use this to come up with a proof. Also, I have to show that $n$ is a non-negative integer

SBS
  • 459
  • 1
    Every natural number can be written as the product of prime factors. Now let $k$ be the number of times, $2$ appears as a prime factor in the aforementioned representation of $n$ and let $m$ be the product of all its other prime factors. This is the representation you're looking for. – Stefan Mesken Sep 21 '16 at 19:46

2 Answers2

2

Let we consider the following algorithm having $n\geq 1$ as input.

  1. Initialization: we set $k=0$ and $m=n$;
  2. If $m$ is odd, we return $(k,m)$;
  3. If $m$ is even, we replace $m$ by $\frac{m}{2}$ and $k$ by $k+1$. Go to $2.$

If $n\leq 2^H$, we perform step $(3.)$ at most $H$ times. It follows that the above algorithm terminates for every input $n$, providing us the wanted representation $$ n=2^k \cdot m.$$ It is the same as considering the binary representation of $n$ and removing the trailing zeroes: that gives $m$. $k$ is just the number of the removed trailing zeroes.

Jack D'Aurizio
  • 353,855
1

Hint:

Use prime decomposition, and remember that $2$ is a prime number ( and $2^0=1$ if $2$ is not a factor of $n$).

Emilio Novati
  • 62,675
  • Can the downvoter say me what is wrong in this hint? – Emilio Novati Sep 21 '16 at 19:56
  • Downvoting without any sense is becoming more and more common these days. I think it should be reasonable to increase the reputation needed to downvote. (+1) back. – Jack D'Aurizio Sep 21 '16 at 20:45
  • I agree that we should leave the freedom to up/downvote in a anonymous way, but we cannot even allow a downvoting spree due to the fact that many users are not able to recognize a valid proof/hint. – Jack D'Aurizio Sep 21 '16 at 20:47
  • 1
    It would be a good practice to explain the downvotes, and useful for those who asked the question and for those who gave the answer. – Emilio Novati Sep 21 '16 at 20:52
  • I completely agree with that, but explanations are not compulsory. Should they become compulsory? I am not sure about that. – Jack D'Aurizio Sep 21 '16 at 20:54