Find the nth term of a quadratic sequence.