Project Euler solutions in Javascript