#!/usr/bin/env pypy3 # 制約再変更後の想定解 # 以前のWriter解はリジャッジでREまたはTLEとなるはず import array MIN_N = 3 MAX_N = 10 ** 6 MIN_L = 1 MAX_L = 2 * 10 ** 7 def sieve_of_eratosthenes(end, typecode="L"): assert end > 1 is_prime = array.array("B", (True for i in range(end))) is_prime[0] = False is_prime[1] = False primes = array.array(typecode) for i in range(2, end): if is_prime[i]: primes.append(i) for j in range(2 * i, end, i): is_prime[j] = False return primes def count_sequences(n, l): def x_max(d): return l - (n - 1) * d d_max = l // (n - 1) if d_max < 2: return 0 ds = sieve_of_eratosthenes(d_max + 1) ans = sum(x_max(d) + 1 for d in ds) return ans def main(): n, l = map(int, input().split()) assert MIN_N <= n <= MAX_N assert MIN_L <= l <= MAX_L print(count_sequences(n, l)) if __name__ == '__main__': main()