Problem 004 solved!
Took out factorization to a common library
Solutions 005, 006 and 007
Problems 008 and 009