recursive to iterative
- changes in exponentiation
- changes in factorials
- so error in clojure sample, maybe a limitation in java?