equal
deleted
inserted
replaced
19 |
19 |
20 |
20 |
21 } |
21 } |
22 |
22 |
23 |
23 |
24 def Collat(n: Long, r: Int = 1) : Int = |
|
25 if (n == 1) r else |
|
26 if (n % 2 == 0) Collat(n / 2 , r + 1) else |
|
27 Collat (3 * n + 1 , r + 1) |
|
28 |
24 |
29 (1 to 10).map(collatz(_)) |
25 (1 to 10).map(collatz(_)) |