Nines in Binary

Number Theory Level pending

Look at the following pattern shown below:

9 in base 10 is 100 1 in binary.

99 in base 10 is 11000 11 in binary.

999 in base 10 is 1111100 111 in binary.

9999 in base 10 is 1001110000 1111 in binary.

Notice that for every n n digits of 9 in mod 10, it will result in n n digits of 1 at its trailing end, in binary.

Will this pattern keep going on forever? Or is there an exception to this?

Yes, this pattern will keep going on forever No, there is an exception to this

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Winston Choo
Sep 26, 2018

This question is easy to understand once you add 1 to everything! Here is how you solve:

Add 1 to everything you see above (Adding in binary is not that hard, the only thing different is that 1 + 1 becomes 0 in binary. Don't forget the carry overs!):

1 0 in base 10 is 101 0 in binary.

1 00 in base 10 is 110001 00 in binary.

1 000 in base 10 is 1111101 000 in binary.

1 0,000 in base 10 is 1001110001 0000 in binary.

Do you see what I see? The number of trailing zeroes in both base 10 and 2 are the same! All we need now is a little bit of logic:

  • 10 is 2(mod 4), and when you times 10, you only get an extra multiple of 2, therefore:

  • 100 is 4(mod 8), and it is not 0(mod 8) because it does not contain 3 multiples of 2!

  • 1000 is 8(mod 16), as it only has 3 multiples of 2, not 4.

And so on......

See that this pattern will keep going on forever? I hope you understand it better than the other solutions!

Hence, by induction, this pattern will keep going on forever, so the answer is Yes.

Brian Moehring
Sep 25, 2018

The answer is "Yes". We'll show this, and a bit more...

Note that 99 9 n 9 s = 1 0 n 1 \overbrace{99\ldots 9}^{n \,\, 9\text{s}} = 10^n - 1 and N in binary ends with 00 11 1 n 1 s N 2 n 1 ( m o d 2 n + 2 ) N \text{ in binary ends with } 00\overbrace{11\ldots 1}^{n \,\, 1\text{s}} \iff N \equiv 2^n-1 \pmod{2^{n+2}} Therefore, we need to check whether 1 0 n 1 2 n 1 ( m o d 2 n + 2 ) 10^n - 1 \equiv 2^n - 1 \pmod{2^{n+2}} for every natural number n . n.

To see this, note that ( 1 0 n 1 ) ( 2 n 1 ) 2 n + 2 = 1 0 n 2 n 2 n + 2 = 5 n 1 2 2 = ( 5 1 ) k = 0 n 1 5 k 2 2 = k = 0 n 1 5 k \begin{aligned} \frac{\left(10^n - 1\right) - \left(2^n - 1\right)}{2^{n+2}} &= \frac{10^n - 2^n}{2^{n+2}} \\ &= \frac{5^n - 1}{2^2} \\ &= \frac{(5-1)\sum_{k=0}^{n-1} 5^k}{2^2} \\ &= \sum_{k=0}^{n-1} 5^k \end{aligned} which is an integer. Therefore, we have shown that 99 9 n 9 s in binary ends with 00 11 1 n 1 s \overbrace{99\ldots 9}^{n \,\, 9\text{s}} \text{ in binary ends with } 00\overbrace{11\ldots 1}^{n \,\, 1\text{s}}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...