Finding the value of x and the general term