In mathematics, Gosper's algorithm, due to Bill Gosper, is a procedure for finding sums of hypergeometric terms that are themselves hypergeometric terms.
If the series is summable in closed form then clearly a rational function ƒ with this property exists; in fact it must always be a polynomial, and an upper bound on its degree can be found.
If it successfully finds S(k) with S(k) − S(k − 1) = a(k), then we are done: this is the required G. If not, there is no such G. Gosper's algorithm finds (where possible) a hypergeometric closed form for the indefinite sum of hypergeometric terms.
So, suppose a(n,k) is a hypergeometric term in both n and k: that is, a(n, k)/a(n − 1,k) and a(n, k)/a(n, k − 1) are rational functions of n and k. Then Zeilberger's algorithm and Petkovšek's algorithm may be used to find closed forms for the sum over k of a(n, k).
Bill Gosper discovered this algorithm in the 1970s while working on the Macsyma computer algebra system at SAIL and MIT.