However, a recursion is not what you need. Recursion would give you A(20) without explicitly calculating the previous values. Sure, you can use a recursive function to fill a series, but that is a waste of time.

What you actually want is an array of values. Your Matlab starts indexing from 1, but C++ likes 0.