Project Euler solutions in JavaScript