Simple js solution to euler 01