Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(n):
- mylist=[]
- while n>1:
- if n%2==0:
- mylist.append(n/2)
- n=n/2
- else:
- mylist.append(3*n+1)
- n=3*n+1
- return len(mylist)
- # print(f(2463))
- # f(27)
- # print(mylist)
- # print(len(mylist))
- def g():
- mylist2=[]
- value=1
- counter=0
- while counter<1:
- if f(value)>199:
- mylist2.append(value)
- counter+=1
- #value+=1
- else:
- value+=1
- return mylist2
- print(g())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement