Good stuff, as always! I'm familiar with recursive functions, and have written one or two recursive macros. But I hadn't heard the term 'recurrence relation' https://en.wikipedia.org/wiki/Recurrence_relation. It's interesting to see how the iterative nature of the DATA step naturally supports this relation, via lag.