generate an algebraic formula for a sequence