SHARE
TWEET

PythonL

a guest Dec 8th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = 120
  2. tab = [False, False]
  3. for i in range(2,n+1):
  4.     tab.append(True)
  5.  
  6. i = 2
  7. while i*i <= n :
  8.     if tab[i]:
  9.         for j in range(i*i,n*i):
  10.             tab[j] = False
  11.     i += 1
  12.  
  13. for i in range(n):
  14.     if tab[i]:
  15.         print(i)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top