#include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int n, l, max = 0; ll ans = 0; cin >> n >> l; int MAX = (l+1)/(n-1) + 1; vector p(MAX+1, 1), primes; p[0] = 0; p[1] = 0; for (int i = 2; i <= MAX; i++){ if (p[i]) primes.push_back(i); for (int j = i*2; j <= MAX; j += i){ p[j] = 0; } } if (!primes.size()) primes.push_back(MAX); for (int i = 0; i < primes.size(); i++){ max = primes[i]*(n-1); ans += (l - max + 1); } cout << ans << endl; }