Bloomberg Interview Question

fairly simple recursive mathematical function