It should be noted that DP functional equations can often be solved nonrecursively.
When solved recursively, it might be necessary – for efficiency reasons
– to adopt some means of avoiding recalculation of values, such as by saving
them for reuse as needed (a process known as memorization). Often, an explicit
stage variable is introduced so as to order the calculations with this in mind.