problem3 now solved with a one liner.... getting factors is much much better than the other solution I concocted originally. I will write tests to prove the factoring, but problem3 is solved.