import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long l = sc.nextLong(); int t = (int)l / (n - 1); ArrayList prime = new ArrayList(); boolean[] is_prime = new boolean[t + 1]; for(int i = 0; i <= t; i++) is_prime[i] = true; is_prime[0] = false; if(t >= 1) is_prime[1] = false; for(int i = 2; i <= t; i++) { if(is_prime[i]) { prime.add((long)i); for(int j = 2 * i; j <= t; j += i) is_prime[j] = false; } } long ans = 0; for(int i = 0; i < prime.size(); i++) { long p = prime.get(i); ans += (l + 1 - p * (long)(n - 1)); } System.out.println(ans); } }