Very inefficiently answer 12

This is actually my very first program ever written in haskell. I need to memoize this but I am out of time for tonight.