Ads project euler problem 002