Generalized solutions with tests to problems on projecteuler.net