Finding the nth term and testing the expression