#include <bits/stdc++.h>
using namespace std;
int main() {
int n;cin>>n;
bool isPrime[n+2];
for(int i =0;i<n+2;i++)
isPrime[i] = true;
for(int i=2;i<n;i++){
//如果是素数,输出,并删掉它的整数倍
if(isPrime[i] == true){
if(i%10 == 1)
cout<<i<<" ";
for(int j = i;j<n;j+=i)
isPrime[j] = false;
}
}
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号