#include <bits/stdc++.h>
#define MAXN 10000010
#define STIZE(x) printf("STIZE%d\n", x)
using namespace std;
int mindel[MAXN], a, b;
long long rez;
void sieve(int B) {
for (int i = 2; i <= B; i++) {
if (!mindel[i]) {
mindel[i] = i;
if (i<=sqrt(B)+1)
for (int j=i*i;j<=B;j+=i)
if(!mindel[j])
mindel[j]= i;
}
}
}
long long zbir(int base, int stepen) {
long long rez = 1;
for(int i = 0; i < stepen; i++) {
rez = base*rez + 1;
}
return rez;
}
long long zbirDelilaca(int n) {
int poc = n;
long long rez = 1;
int curMinDel = mindel[n];
int cnt = 0;
while(n > 1) {
if(curMinDel != mindel[n]) {
rez *= zbir(curMinDel, cnt);
curMinDel = mindel[n];
cnt = 0;
}
n /= mindel[n];
cnt++;
}
rez *= zbir(curMinDel, cnt);
return rez - poc;
}
int main() {
scanf("%d%d", &a, &b);
sieve(b);
for(int i = a; i <= b; i++) {
rez += abs(i - zbirDelilaca(i));
}
printf("%lld", rez);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgTUFYTiAxMDAwMDAxMAojZGVmaW5lIFNUSVpFKHgpIHByaW50ZigiU1RJWkUlZFxuIiwgeCkKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1pbmRlbFtNQVhOXSwgYSwgYjsKbG9uZyBsb25nIHJlejsKdm9pZCBzaWV2ZShpbnQgQikgewogICAgZm9yIChpbnQgaSA9IDI7IGkgPD0gQjsgaSsrKSB7CiAgICAgICAgaWYgKCFtaW5kZWxbaV0pIHsKICAgICAgICAgICAgbWluZGVsW2ldID0gaTsKICAgICAgICAgICAgaWYgKGk8PXNxcnQoQikrMSkKICAgICAgICAgICAgICAgIGZvciAoaW50IGo9aSppO2o8PUI7ais9aSkKICAgICAgICAgICAgICAgICAgICBpZighbWluZGVsW2pdKQogICAgICAgICAgICAgICAgICAgICAgICBtaW5kZWxbal09IGk7CiAgICAgICAgfQogICAgfQp9CmxvbmcgbG9uZyB6YmlyKGludCBiYXNlLCBpbnQgc3RlcGVuKSB7CiAgICBsb25nIGxvbmcgcmV6ID0gMTsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBzdGVwZW47IGkrKykgewogICAgICAgIHJleiA9IGJhc2UqcmV6ICsgMTsKICAgIH0KICAgIHJldHVybiByZXo7Cn0KbG9uZyBsb25nIHpiaXJEZWxpbGFjYShpbnQgbikgewogICAgaW50IHBvYyA9IG47CiAgICBsb25nIGxvbmcgcmV6ID0gMTsKICAgIGludCBjdXJNaW5EZWwgPSBtaW5kZWxbbl07CiAgICBpbnQgY250ID0gMDsKICAgIHdoaWxlKG4gPiAxKSB7CiAgICAgICAgaWYoY3VyTWluRGVsICE9IG1pbmRlbFtuXSkgewogICAgICAgICAgICByZXogKj0gemJpcihjdXJNaW5EZWwsIGNudCk7CiAgICAgICAgICAgIGN1ck1pbkRlbCA9IG1pbmRlbFtuXTsKICAgICAgICAgICAgY250ID0gMDsKICAgICAgICB9CiAgICAgICAgbiAvPSBtaW5kZWxbbl07CiAgICAgICAgY250Kys7CiAgICB9CiAgICByZXogKj0gemJpcihjdXJNaW5EZWwsIGNudCk7CiAgICByZXR1cm4gcmV6IC0gcG9jOwp9CgppbnQgbWFpbigpIHsKICAgIHNjYW5mKCIlZCVkIiwgJmEsICZiKTsKICAgIHNpZXZlKGIpOwogICAgZm9yKGludCBpID0gYTsgaSA8PSBiOyBpKyspIHsKICAgICAgICByZXogKz0gYWJzKGkgLSB6YmlyRGVsaWxhY2EoaSkpOwogICAgfQogICAgcHJpbnRmKCIlbGxkIiwgcmV6KTsKICAgIHJldHVybiAwOwp9Cg==