+0  
 
0
514
1
avatar

How many zeroes do we write when we write all the integers from 1 to 256 in binary?

 Jul 2, 2021
 #1
avatar+373 
+5

Hey there, Guest!

 

So...

 

An n number is a 1 followed by 2^(n-1) combinations of n-1 0's and ones, symmetrically distributed, hence (n-1)2^(n-2) zeros.

 

In total,

 

1+2*2+3*4+4*8+5*16+6*32+7*64+8=777.

 

so that for numbers between 0 and 2^n, the number of zeroes is

 

(n−2)2^(n−1)+n+1

 

Hope this helped! :)

( ゚д゚)つ Bye

 Jul 2, 2021

0 Online Users