Answers to Project Euler questions in Ruby and JavaScript