Added Fermat number test to test.py, cleaned up code a little and changed to binary n & 1 and bit shifting (n >> 1) for checking divisibility by 2 and division by 2 respectively.