#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <climits>
using namespace std;
#define int long long
const int N = 2000000,mod = 1e9+7;
int n,m,vis[N*10],a[25],b[N];
int32_t main(){
scanf("%lld%lld",&n,&m);
int cnt=0;
for(int i=1;i<=20;i++){
for(int j=1;j<=m;j++){
if(!vis[i*j]){
vis[i*j]=1;
++cnt;
}
}
a[i]=cnt;
}
int res=1;
for(int i=2;i<=n;i++){
if(b[i]==1) continue;
int cnt=1;
for(int j=i;j<=n;j=j*i){
b[j]=1;
++cnt;
}
--cnt;
res+=a[cnt];
}
cout<<res<<endl;
}
|