Last active
December 18, 2015 13:29
-
-
Save daewon/5790362 to your computer and use it in GitHub Desktop.
Euler 프로젝트 실습 10번
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
def isPrime(n: Long) = (2L to math.sqrt(n).toInt).forall(n % _ != 0) | |
// val sum = (2L to 2000000L).filter(isPrime).sum | |
val sum = 2 + (3L to 2000000L by 2).filter(isPrime).sum | |
assert(sum == 142913828922L) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment