Finding the specific term in a sequence