COINS.py: Added storing of already calculated values
COINS_test.py: Added end case