val factorials: LazyList[BigInt] =
BigInt(1) #:: factorials.zip(LazyList.from(2).map(BigInt.apply)).map {
case (a, b) => a * b
}
val fibs: LazyList[BigInt] =
BigInt(0) #:: BigInt(1) #:: fibs.zip(fibs.tail).map { case (a, b) => a + b }
factorials.take(10).toList // : List[BigInt] = List(1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800)
fibs.take(10).toList // : List[BigInt] = List(0, 1, 1, 2, 3, 5, 8, 13, 21, 34)