val m = 16val a = 5val c = 1val X0 = 10def ran(n: Int, X: Int) : Set[Int] = n match { case 0 => Set() case n => { val X_new = (a * X + c) % m Set(X) ++ ran(n - 1, X_new) }}for (i <- 0 to 16) { val l = ran(16, i) println(l.size.toString + " " + l.toString)}