Project Euler problems solved using JavaScript