Chains of recurrences can be used as compiler optimization to transform loops/recursion/fold into closed form calculation. Related induction variable Reference C++Now 2021 “Algorithms from a Compiler Developer’s Toolbox”