Skip to content

Instantly share code, notes, and snippets.

@mbc9news
Last active December 18, 2015 11:49
Show Gist options
  • Save mbc9news/5778401 to your computer and use it in GitHub Desktop.
Save mbc9news/5778401 to your computer and use it in GitHub Desktop.
object Euler_010 extends App {
def sumPrimeList(pList:List[Int], pSum:Long = 0):Long = {
// println(pList.length)
if(pList.length equals 0) return pSum
sumPrimeList(pList.filterNot(n => n%pList.head equals 0), pSum+pList.head)
}
sumPrimeList((2 to 10).toList)
sumPrimeList((2 to 2000000).toList)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment