import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int L = sc.nextInt(); long answer = 0; boolean[] is_prime = new boolean[L + 1]; Arrays.fill(is_prime, true); is_prime[0] = is_prime[1] = false; for(int i = 2; i <= L; i++){ if(!is_prime[i]){ continue; } is_prime[i] = true; for(int j = i * 2; j <= L; j += i){ is_prime[j] = false; } } for(int diff = 1; ; diff++){ final long size = diff * (N - 1); if(size > L){ break; } if(!is_prime[diff]){ continue; } final long rest = L - size; //System.out.println(diff + ":" + L + " - " + size + " = " + rest); answer += (rest + 1); } System.out.println(answer); } }