#include typedef long long int LL; LL n, l, ans; int comp[10000001]; int main() { scanf("%lld%lld", &n, &l); for(int i = 2; i <= 10000000; i++) { if(comp[i] == 0) { for(int j = i * 2; j <= 10000000; j += i) { comp[j] = 1; } } } ans = 0; for(LL i = 2; i <= 10000000; i++) { if(comp[i] == 0) { LL temp = l + 1 - i * (n - 1); if(temp > 0) { ans += temp; } } } printf("%lld\n", ans); return 0; }