#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
int left, right, m, n, k, sum;
while(scanf("%d %d", &m, &n) != EOF && m != 0 && n != 0){
left = right = m;
k = 1;
while(2 * right + 1 <= n){
right = 2 * right + 1;
left *= 2;
++k;
}
sum = pow(2, k) - 1;
if(2 * left <= n) sum += n - 2 * left + 1;
printf("%d\n", sum);
};
return 0;
}
0.0分
1 人评分