added git ignore file
moved factors function into lib.js os all problems can use it
solved problem 7