#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; vector p(MAX, 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; } } for (int i = 0; primes[i]*(n-1) <= l; i++){ max = primes[i]*(n-1); if ((l - max + 1) > 0) ans += (l - max + 1); } cout << ans << endl; }