#include<bits/stdc++.h>
using namespace std;

long long ara[2000006],tra[2000006];

int main()
{


        int n,m,a,b,c,d,e,p,q,l,r,s,fr,sc,tr,sz=0,tz,i,j,k,mx=LLONG_MIN,mn=LLONG_MAX;
        int x=0,y=0,cnt=0,res=0,ans=0,sum=0; int flg=0,flag=1,na=0,as=1;
        vector<int>u,v,w; vector< pair<int,int> >vct; vector<string>vst;
        set<int>st,nt,tt; map<int,int>mp,nq,qr; string str,ttr,ntr;

        long long g,h,aa,bb,cc,dd,f;

        scanf("%d %d",&l,&r);  g=r-l+1;  h=g*g;

        for(i=r;i>=1;i--)
        {

            s=0; q=0;

            s=r/i;  q=(l-1)/i;  p=s-q;

            aa=(long long)p;

            f=aa*aa;

            if(i!=1)
            {
                if(i>=l)
                {
                    p=p*2; p--;  x=x+p;
                }
            }

            ara[i]=f-tra[i];


            if(i!=1)
            {

                for(j=1;j*j<=i;j++)
                {
                    if(i%j==0)
                    {
                        fr=j;  sc=i/j;

                        tra[fr]=tra[fr]+ara[i];

                        if(sc!=i && sc!=fr)
                        {
                            tra[sc]=tra[sc]+ara[i];

                        }

                    }

                }

            }


            //cout<<i<<"    "<<ara[i]<<"     "<<p<<"        "<<tra[i]<<endl;
        }

        //cout<<ara[1]<<"   "<<x<<endl;

        h=h-ara[1];  h=h-x;

        printf("%lld\n",h);













   return 0;


}


#include<bits/stdc++.h>
using namespace std;
void __print(int x){cout<<x;}void __print(long x){cout<<x;}
void __print(long long x){cout<<x;}void __print(unsigned x){cout<<x;}
void __print(unsigned long x){cout<<x;}void __print(unsigned long long x){cout<<x;}
void __print(float x){cout<<x;}void __print(double x){cout<<x;}
void __print(long double x){cout<<x;}void __print(char x){cout<<'\''<<x<<'\'';}
void __print(const char *x){cout<<'\"'<<x<<'\"';}void __print(const string &x){cout<<'\"'<<x<<'\"';}
void __print(bool x) {cout<<(x?"true":"false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
           
#define lp(i,a,b)       for (int i=a;i<=b;i++)
#define rp(i,a,b)       for (int i=a;i>=b;i--)
#define ms(a,x)         memset(a,x,sizeof a)
#define int             long long 
#define ff              first
#define ss              second
#define all(a)          a.begin(),a.end()
#define rall(a)         a.rbegin(),a.rend()
#define pb              push_back
#define nl              cout<<"\n"
#define gcd(a,b)        __gcd((a),(b))
#define lcm(a,b)        (((a)*(b))/(gcd(a,b)))
#define sq(a)           ((a)*(a))
#define sz(a)           (int) a.size()
#define mod             998244353
#define PI              (2*acos(0.0))

const int N=1e6+5;
int cnt[N],A[N],ex[N];

void solve()
{
  int l,r;
  cin>>l>>r;
  lp(i,l,r)
    cnt[i]++;
  for(int i=1;i<N;i++)
  {
    int sum=0;
    for(int j=i;j<N;j+=i)
    {
      sum=(sum+cnt[j]);
    }
    A[i]=sum;
  }
  int now=r-l+1;
  int ans=(now*(now-1));
  for(int i=N-1;i>=1;i--)
  {
    ex[i]=(A[i]*(A[i]-1));
    //if(ex[i]>0)
    {
    for(int j=i+i;j<N;j+=i)
      ex[i]=(ex[i]-ex[j]);
    }
  }
  ans-=ex[1];
  if(l==1) l++;
  lp(i,l,r)
  {
    for(int j=i+i;j<=r;j+=i)
      ans-=2;
  }
  cout<<ans;
}

signed main()
{
  ios_base::sync_with_stdio(false); 
  cin.tie(NULL); cout.tie(NULL);
  int T=1;
  //cin>>T;
  while(T--) solve();
}
