N, L = map(int, raw_input().split()) right = L / (N - 1) field = [0] * (right + 1) i = 2 ans = 0 while i <= right: if field[i] == 0: k = i * i while k <= right: field[k] = 1 k += i ans += L - i * (N - 1) + 1 if i == 2: i += 1 else: i += 2 print ans