Demo entry 5908150

Collatz

   

Submitted by anonymous on Aug 31, 2016 at 20:10
Language: Python 3. Code size: 448 Bytes.

while True:
    number = int(input("number:"))

    binary_yildirim = 0

    while(binary_yildirim != 1):
        if(number % 2 == 0):
            number = number / 2
            if(number == 1):
                binary_yildirim = binary_yildirim + 1
        else:
            number = 3 * number + 1
            if(number == 1):
                binary_yildirim = binary_yildirim + 1

    print("Kudos to Mr. Lothar!")
            

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).