For this Question: Golu wants to find out the sum of Lucky numbers. Lucky numbers are those numbers that contain exactly two set bits. So Help Golu to find the sum of those numbers which exactly contain two set bits up to a given number N.
3 5 10 are lucky numbers whereas 7 14 are not.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You have to complete the function <b>Lucky()</b> that takes the integer N as parameter.

<b>Constraints:</b>
1 &le; T &le; 10
1 &le; N &le; 10<sup>18</sup>Print the sum of all Lucky Numbers upto N. Output may be large so take modulo with 1000000007.Sample Input:-
1
5
Sample Output:-
8

Sample Input:-
1
7
Sample Output:-
14, I have written this Solution Code: class Solution {

    
    public void Lucky(long n) {
		long M=1000000007;
        long d,i,j;
         if(n<=2)
		{
		    	System.out.println(0);
		}
		else
		{
			long sum=0,m,k,count;
			d=3;i=1;count=0;
			while(d<=n)
			{
				sum=(sum+d)%M;
				m=1;k=1;
				//cout<<d<<" ";
				for(j=1;j<i;j++)
				{
					
					if((d+m)<=n)
					{
						sum=(sum+d+m)%M;
					}
					else
					{
						break;
					}
					k=k*2;
					m=m+k;
					count++;
				}
				d=(d-1)*2+1;
				i++;
				count++;
			}
			System.out.println(sum);
			
		}
    }
    
}
 , In this Programming Language: Java, Now tell me if this Code is compilable or not?