start=int(raw_input("Please enter a starting value: "))
value=start
while value>1:
print value
if (value%2)==0:
value=value/2
else:
value=3*value+1
print value
Subscribe to:
Post Comments (Atom)
Blogs and study guide for Stony Brook University Midterms.
No comments:
Post a Comment