Is there a (simple) recipe for producing LaTeX code requiring exactly n compilations? (That is, I'm looking for an algorithm/function f(n) with domain {1, 2, 3, ...} and LaTeX code as its range.) If that makes answering easier, I'll be happy about a solution requiring n to be above a certain threshold (say, 2 or 3), since most ordinary code requires not more than 2 or 3 runs of latex. Ideally the solution isn't too contrived and easy to comprehend; direct solutions as well as solutions with recursive characteristics are welcome.
Note: This question grew out of this question about patterns increasing the number of required LaTeX compilation runs.
