Solutions for Project Euler problems in PHP, Ruby and Javascript