Project Euler Problem 2 solved js