<filename>Days/Day 23 - Opening the Turing Lock/Part 2.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sat Jan  6 23:38:33 2018

@author: <NAME>
"""

initial_a = 1
a = initial_a

a *= 9
a += 2
a *= 3
a += 2
a *= 3
a += 1
a *= 3
a += 1
a *= 3
a += 1
a *= 3
a += 2
a *= 3
a += 2
a *= 9
a += 1

b = 0       
while a != 1:
    b += 1
    if a % 2 == 0:
        a //= 2
    else:
        a = 3*a + 1
    
print(b)
    
<filename>Days/Day 23 - Opening the Turing Lock/Part 2.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sat Jan  6 23:38:33 2018

@author: <NAME>
"""

initial_a = 1
a = initial_a

a *= 9
a += 2
a *= 3
a += 2
a *= 3
a += 1
a *= 3
a += 1
a *= 3
a += 1
a *= 3
a += 2
a *= 3
a += 2
a *= 9
a += 1

b = 0       
while a != 1:
    b += 1
    if a % 2 == 0:
        a //= 2
    else:
        a = 3*a + 1
    
print(b)
    
# -*- coding: utf-8 -*- Created on Sat Jan  6 23:38:33 2018  @author: <NAME>