Euler 14 in JS