Simple Java Solution 4 Lines of Code:
\nclass Solution {\n    public int concatenatedBinary(int n) {\n        long val=0, i=0;\n        while(i++<n)\n            val= ((val<<(1+(int)(Math.log(i)/Mat
```\nclass Solution {\n    public int concatenatedBinary(int n) {\n        long val=0, i=0;\n        while(i++<n)\n            val= ((val<<(1+(int)(Math.log(i)/Math.log(2))))+i)%1000000007;\n        return (int)val;\n    }\n}\n```
['Bit Manipulation']