electro177's blog

By electro177, history, 23 months ago, In English

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.


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.


Some help what to do

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
23 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Same problem has been discussed here.