Skip to content

Instantly share code, notes, and snippets.

@kazua
Created January 6, 2013 05:21
Show Gist options
  • Save kazua/4465410 to your computer and use it in GitHub Desktop.
Save kazua/4465410 to your computer and use it in GitHub Desktop.
Project Euler Problem 25
//http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2025
//K.A
object problem025 {
def getFbnDgtFst(dc : Int) : BigInt = {
lazy val fbn: Stream[BigInt] = BigInt(0) #:: fbn.scanLeft(BigInt(1))(_+_).takeWhile(_.toString.length < dc)
fbn.size
}
def main(args : Array[String]) {
val dc = 1000
println(getFbnDgtFst(dc))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment