Tap here to switch tabs
Problem
Submissions

Problem: Concatenation of Consecutive Binary Numbers

Concatenation of Consecutive Binary Numbers takes an integer n, joins the binary representations of every integer from one through n in order, and returns its decimal value modulo a large prime.

Statement

Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of all integers from 11 to n in sequential order, modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Concatenation of Consecutive Binary Numbers

Concatenation of Consecutive Binary Numbers takes an integer n, joins the binary representations of every integer from one through n in order, and returns its decimal value modulo a large prime.

Statement

Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of all integers from 11 to n in sequential order, modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤105\leq 10^5