public static int rho(long x) {
    	int res = 1;
    	// While the Least Significant Bit is 0 but x is not zero
    	while ((x & 1) == 0 && x != 0) {
    		res++;
    		x >>>= 1; // Offset one bit to the left
    	}
    	return res;
    }