caird coinheringaahing ♦
- 50.9k
- 11
- 133
- 364
Lua (75 bytes)
function C(x)z=0 while x>1 do x=({x//2,3*x+1})[x%2+1]z=z+1 end return z end
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchangefunction C(x)z=0 while x>1 do x=({x//2,3*x+1})[x%2+1]z=z+1 end return z end