Recursive nested sum

174 Views Asked by At

I came across this function and I need to simplify it as much as possible, from a programming perspective, I can't afford $O(N)$ per sum. $$G(N,D) = \sum_{i=1}^N F_i(D) $$ such that F is defined as follow : $$ \begin{cases} F_i(X) = \sum_{j=1}^X F_{i-1}(j) & \text{if $i > 0$} \\ F_0(X) = 1 & \text{Otherwise} \\ \end{cases} $$