Scala, 50 bytes Stream.iterate(_)(x=>Seq(x/2,3*x+1)(x%2))indexOf 1 Try it in Scastie!
posted 3y ago by user
# Scala, 50 bytes ```scala Stream.iterate(_)(x=>Seq(x/2,3*x+1)(x%2))indexOf 1 ``` [Try it in Scastie!](https://scastie.scala-lang.org/3iumEKb4Taei3vyfO8GPVQ)