complete euler #4 in JS