How can I do a recursive formula?

This might set you in the right direction