Euler 62 Problem with scala