I could not find any such query. Given a range and the index i, we want to count the numbers in the range that have bit i set.
Eg, range=[6,13] and i=2, ans=4
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
Is there a better approach than traversing the range