Lucky Numbers by chocobi

a[999],i,j,k;main(c){for(scanf("%d",&i);c<=i;c+=2)if(!a[c])for(printf("%d\n",c),j=k=1;j<=i;j+=2)c>1&&!a[j]&&!(k++%c)&&++a[j];}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page