Sha256: 1a82b971526ee25799e19506fb2f1d0209189572c51cc6b5334e1a452c00aa78
Contents?: true
Size: 233 Bytes
Versions: 124
Compression:
Stored size: 233 Bytes
Contents
return function(n) assert(n > 0, 'Only positive numbers are allowed') local steps = 0 while n > 1 do if n % 2 == 0 then n = n / 2 else n = 3 * n + 1 end steps = steps + 1 end return steps end
Version data entries
124 entries across 124 versions & 1 rubygems