Skip to content

Instantly share code, notes, and snippets.

@daewon daewon/gist:5790362
Last active Dec 18, 2015

What would you like to do?
Euler 프로젝트 실습 10번
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
You can’t perform that action at this time.