require 'prime' N, L = gets.split.map(&:to_i) ans = Prime.each((L + 1) / (N - 1)).map {|p| L + 1 - p * (N - 1)}.inject(0, :+) puts ans