import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { static int INF = 2 << 27; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextInt(); long L = sc.nextInt(); List l = makePrimeList(L); long sum = 0; for(int i = 0; i < l.size(); i++) { long len = (N-1) * (long)l.get(i); if(len > L) break; sum += L - len+1; } System.out.println(sum); } static List makePrimeList(long max) { List ret = new ArrayList<>(); boolean[] isntPrime = new boolean[(int)max+1]; ret.add(2); for(int i = 3; i <= max; i += 2) { if(!isntPrime[i]) { ret.add(i); for(int j = i + i ; j <= max; j += i) { isntPrime[j] = true; } } } return ret; } }