Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. def f(n):
  2. mylist=[]
  3. while n>1:
  4. if n%2==0:
  5. mylist.append(n/2)
  6. n=n/2
  7. else:
  8. mylist.append(3*n+1)
  9. n=3*n+1
  10. return len(mylist)
  11. # print(f(2463))
  12. # f(27)
  13. # print(mylist)
  14. # print(len(mylist))
  15. def g():
  16. mylist2=[]
  17. value=1
  18. counter=0
  19. while counter<1:
  20. if f(value)>199:
  21. mylist2.append(value)
  22. counter+=1
  23. #value+=1
  24. else:
  25. value+=1
  26. return mylist2
  27. print(g())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement