Last active
January 27, 2024 01:04
-
-
Save chemacortes/84847f9a8b623b79482ea74337dadd50 to your computer and use it in GitHub Desktop.
Fibonacci succession with scala3 (oneline versions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val fibs: LazyList[BigInt] = BigInt(1) #:: BigInt(1) #:: (fibs zip fibs.tail).map(_+_) | |
val fibs: LazyList[BigInt] = 1 #:: fibs.scan(BigInt(1))(_+_) | |
val lucas: LazyList[BigInt] = 2 #:: fibs.scan(BigInt(1))(_+_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment