Chains of recurrences can be used as compiler optimization to transform loops/recursion/fold into closed form calculation.

Reference

  • C++Now 2021 “Algorithms from a Compiler Developer’s Toolbox”