In mathematics, the term generating function is used to describe an infinite sequence of numbers (a n) by treating them as the coefficients of a series expansion. The sum of this infinite series is the generating function.