Leaderboard
Showing:
Handle Score
@Ibrahim Nash 5725
@blackshadows 5685
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4908
@saiujwal13083 4156
@sanjay05 3762
@marius_valentin_dragoi 3511
@sushant_a 3453
@KshamaGupta 3318
@the_coder95 3302
Complete Leaderboard
Prime number of set bits
Easy Accuracy: 52.37% Submissions: 7106 Points: 2

Given two integers ‘L’ and ‘R’, write a program that finds the count of numbers having prime number of set bits in their binary representation in the range [L, R].

Input:
The first line consists of an integer T i.e number of test cases. The first and only line of each test case consists of two integers L and R

Output:
Print the required output.

Constraints: 
1<=T<=100
1<=L<=R<=100000

Example:
Input:

2
6 10
10 15 

Output:
4
5

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Prime number of set bits

Output Window