#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> PII;
typedef pair<PII, int> PPI;
typedef long long LL;
const int MaxN=100000;
vector <PPI> IN;
vector <LL> P;
LL ans[MaxN]; // [0 ~ IN.size()-1]
map <LL, LL> mp;
map <LL, LL> ::iterator ii;

void init(){
    int n,x,cnt=0;
    while (scanf("%d%d",&n,&x)!=EOF){
        if (n==0 && x==0) break; //return; = =...
        IN.push_back(PPI(PII(n,x),cnt++));
    }
    sort(IN.begin(),IN.end());
}

void getPrime(){
    for (int i=2; i<=MaxN; i++){
        int flag=1, z=sqrt(i);
        for (int j=0; j<P.size(); j++){
            if (P[j]>z) break;
            if (i%P[j]==0){ flag=0; break; }
        }
        if (flag) P.push_back(i);
    }
}

LL nPre;
LL a[MaxN];

inline void getFactor(int n){
    for (int i=0; i<P.size(); i++){
        if (P[i]>n) return;
        while (n%P[i]==0){
            a[i]++; n/=P[i];
        }
    }
}

inline void geta(int nNow){
    for (int i=nPre+1; i<=nNow; i++) getFactor(i);
    nPre=nNow;
}

inline LL calc(LL n){
    return n*(n-1)/2;
}

inline LL gao(int x){
    LL rst=0;
    int i,j,k,w;
    for (i=0; i<P.size(); i++){
        if (a[i]<x) break;
        for (k=1; k<=a[i]; k++){
            int tt=a[i]/k;
            if (tt<x) break;
            int sum=1;
            for (w=0; w<P.size(); w++) if (w!=i){
                if (a[w]<tt) break;
                if (w<i)
                    sum*=(a[w]/(tt+1)+1);
                else
                    sum*=(a[w]/tt+1);
            }
            mp[tt]+=sum;
        }
    }
    for (ii=mp.begin(); ii!=mp.end(); ii++)
        if (ii->first>=x) rst+=calc(ii->second);
    return rst;
}

int main(){
    getPrime();
    init();
    for (int i=0; i<IN.size(); i++){
        geta(IN[i].first.first);
        mp.clear();
        int xNow=IN[i].first.second;
        ans[IN[i].second]=gao(xNow);
    }
    for (int i=0; i<IN.size(); i++) cout << ans[i] << endl;
    return 0;
}
