#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int maxN = 1e6 + 5;
ll arr[maxN] = { 0 };
void init()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
}
/*
 * 1) First filter out the pairs which have gcd > 1. To compute this, we 
 * we need to know (1/2 + 1/3 + ... + 1/n) * n = nlogn
 * 2) Second exclude those pairs where gcd(a, b) = min(a, b)
 */
int main()
{
    init();
    int l, r;
    cin >> l >> r;
    ll res = 0;
    for (int i = r; i >= 2; --i) {
        int num = r / i - (l - 1) / i;
        arr[i] += 1LL * num * num;
        for (int j = 2 * i; j <= r; j += i) {
            arr[i] -= arr[j];
        }
        res += arr[i];
    }
    for (int i = max(2, l); i <= r; ++i) {
        int rr = r / i;
        res -= rr * 2 - 1;
    }
    cout << res << endl;
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)


int main(){
  int L,R; cin >> L >> R;
  int N = R;
  vector<ll> T(N+1,0);
  T[1] = 1;
  for(int a=1; a<=N; a++) for(int b=a*2; b<=N; b+=a) T[b] -= T[a];

  ll ans = 0;

  for(int g=2; g<=R; g++){
    int l = max(1, (L-1) / g);
    int r = R / g;
    for(int i=1; i<=r; i++) ans += T[i] * (r/i - l/i) * (r/i - l/i);
  }

  cout << ans << "\n";
  return 0;
}

struct ios_do_not_sync{
  ios_do_not_sync(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
  }
} ios_do_not_sync_inst;
