project euler #10 in javascript