google practice problem

Revision en1, by electro177, 2021-07-24 05:54:15

A big binary number

You are given a number n. Find the decimal value of the number that is formed by concatenating the binary representations of the first n positive

Integers. Print the answer modulo 10^9 +7.

Example

Consider N = 2:

The binary representation of 1 is 1.

• The binary representation of 2 is 10

. So the number form after concatenation is 110. in decimals this is equivalent to 6.

n<1e9;

Some help what to do

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English electro177 2021-07-24 05:54:15 472 Initial revision (published)