Just another algorithm today…
This is the Fibonacci series implemented using memoization technique.
Typically, If you are designing a maths library, you would implement a caching mechanism to avoid reprocessing again. A better way in term of performance would be: