JS answer for first euler problem