#include "bits/stdc++.h" using namespace std; #define ll long long int #define rep(i,n) for( int i = 0; i < n; i++ ) #define rrep(i,n) for( int i = n; i >= 0; i-- ) #define REP(i,s,t) for( int i = s; i <= t; i++ ) #define RREP(i,s,t) for( int i = s; i >= t; i-- ) #define dump(x) cerr << #x << " = " << (x) << endl; #define INF 2000000000 #define mod 1000000007 #define INF2 1000000000000000000 bool is_prime[10000010]; int primes[2000000]; void setPrime() { for (int i = 2; i <= 10000000; i++) is_prime[i] = true; for (int i = 2; i <= 10000000; i++) { if (is_prime[i]) { for (int j = i * 2; j <= 10000000; j += i) { is_prime[j] = false; } } } int id = 0; for (int i = 2; i <= 2000000; i++) { if (is_prime[i]) primes[id++] = i; } } int main(void) { cin.tie(0); ios::sync_with_stdio(false); int N, L; cin >> N >> L; setPrime(); ll ans = 0; int i = 0; while(true) { int add = L - primes[i++] * (N - 1) + 1; if (add > 0) ans += add; else break; //cout << primes[i] << " " << ans << endl; } cout << ans << endl; return 0; }