Answers to Project Euler questions in Javascript