Prime number of set bits
Submissions: 4665   Accuracy:

49.84%

  Difficulty: Easy   Marks: 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

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.