solutions1/collatz.scala
changeset 266 31e5218f43de
parent 208 ab0ccbc8271f
child 282 2d290b79fc73
equal deleted inserted replaced
265:2692329287bb 266:31e5218f43de
     1 // Part 1 about the 3n+1 conjecture
     1 // Part 1 about the 3n+1 conjecture
     2 //==================================
     2 //==================================
     3 
     3 
       
     4 // generate jar with
       
     5 //   > scala -d collatz.jar  collatz.scala
     4 
     6 
     5 object CW6a { // for purposes of generating a jar
     7 object CW6a { // for purposes of generating a jar
     6 
     8 
     7 def collatz(n: Long): Long =
     9 def collatz(n: Long): Long =
     8   if (n == 1) 0 else
    10   if (n == 1) 0 else