Created
January 6, 2013 05:21
-
-
Save kazua/4465410 to your computer and use it in GitHub Desktop.
Project Euler Problem 25
This file contains hidden or 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
| //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