Add .gitignore to project

Add .gitignore and exclude Python 3 cache files.
Refactor problems 2 and 3 by extracting functions

Refactor problems 2 and 3 by extracting common used functions for prime and
fibonacci number calculation.
Solve problem 7