m=7**6 a=[1]*-~m i=j=1 while i<m: i+=1 if a[i]:a[i::i]=m/i*[0];a[j]=i;j+=1 while 1:print a[input()]
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page