implementation of testing for Exercise 2 of euler