Pergunta de entrevista da empresa Trexquant Investment

A recursion problem for the technical interview.