Advertisement
stiansjogren

Untitled

Nov 30th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import numpy as np
  2.  
  3.  
  4.  
  5. def colloratz(numb):
  6. if numb%2==0:
  7. return (numb/2)
  8. else:
  9. return (3*numb+1)
  10.  
  11.  
  12. vec = []
  13.  
  14. for numb in xrange(2,10*3):
  15. cnt=0
  16. while numb is not 1:
  17. numb=colloratz(numb)
  18. cnt+=1
  19. vec.append(cnt)
  20. np.histogram(vec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement