Project Euler - Scala - Problem 1