There many examples of families of functions where each function can be computed as a linear combination of the two previous terms
where a and b are functions of x but not on n. This is called a three-term recurrence formula.
It’s amazing how often you can run into three-term recurrence formulas. There are theorems that give conditions for such recurrences to hold, but I haven’t reached the bottom of that rabbit hole [1].
For this post I just want to give examples.
Bessel functions of the first and second kind:
Modified Bessel functions of the first and second kind:
Chebyshev polynomials of the first and second kind:
Hermite polynomials (physicists’ convention):
Legendre polynomials:
[1] See Bochner’s theorem for orthogonal polynomials, the Nikiforov–Uvarov method, and Infeld-Hull factorization.