diff -r 0a42d73e795b -r 4b454a6d1814 progs/collatz.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/progs/collatz.scala Sun Aug 21 00:37:27 2016 +0100 @@ -0,0 +1,5 @@ +def collatz(n: BigInt) : Boolean = { + if (n == 1) true else + if (n % 2 == 0) collatz(n / 2) else + collatz(3 * n + 1) +}