JavaScript Solution
\tvar concatenatedBinary = function(n) {\n\t\tconst mod = 1000000007;\n\t\tlet len = 1, num = 0;\n\n\t\tfor (let i = 1; i <= n; i++) {\n\t\t\tfor (let j = 0; j 
\tvar concatenatedBinary = function(n) {\n\t\tconst mod = 1000000007;\n\t\tlet len = 1, num = 0;\n\n\t\tfor (let i = 1; i <= n; i++) {\n\t\t\tfor (let j = 0; j < len; j++) {\n\t\t\t\t num = (num << 1) % mod;\n\t\t\t}\n\n\t\t\tnum = (num + i) % mod;\n\n\t\t\tif (((i+1) & i) === 0) {\n\t\t\t\tlen++;\n\t\t\t}\n\t\t}\n\n\t\treturn num;\n\t};\n\n\t/*\n\t  1  10  11  100 101 110 111 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111\n\n\t  1  6   27  220 \n\t*/
[]