Adding project eulwe problem 18 in jS