#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pint; typedef vector vint; typedef vector vpint; #define mp make_pair #define fi first #define se second #define all(v) (v).begin(),(v).end() #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) bool isprime[10000010];//trueならiは素数 //エラトテネス void eratos(int m){ for (int i = 0; i <= m; ++i) isprime[i] = true; isprime[0] = isprime[1] = false; //iを残してiの倍数を消していく for (int i = 2; i <= m; ++i){ if(isprime[i]){ for (int j = 2 * i; j <= m; j += i){ isprime[j] = false; } } } return; } int main(void){ int n, l; cin >> n >> l; eratos(1000000); printf("ok\n"); ll ans = 0; n--; ll p = 2; while(n * p <= l){ printf("%lld\n",n * p ); if(isprime[p]){ ll nagasa = n * p; ans += (l - nagasa + 1); } p++; } printf("%lld\n", ans); return 0; }