Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. import numpy as np
  3. import scipy as sc
  4.  
  5.  
  6.  
  7.  
  8. def pierwsze(n):
  9. poczatek = 2;
  10. a = np.arange(2,n+1,1)
  11. b = np.array(a)
  12. print(b);
  13. for x in b:
  14.  
  15. if x%2 == 0:
  16. if x!=2:
  17. b[(x-poczatek)] = 0
  18. elif x%3 == 0:
  19. if x!=3:
  20. b[(x-poczatek)] = 0
  21. tmp = (np.mod(b,3)!=0)
  22.  
  23. print(b[tmp])
  24. n = 20
  25. pierwsze(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement