Finding the common difference and next terms