Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Better challenge

Name: Anonymous 2011-02-09 11:54

Prove that this program terminates for all positive values of n.


def sequence(n):
  while n != 1:
    print n,
    if n%2 == 0:        # n is even
      n = n/2
    else:               # n is odd
      n = n*3+1

Name: Anonymous 2011-02-10 17:43

I'm working on a proof based on bit shifts but my anus hurts and it's not done yet

is there any known formal solution for this?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List