Finding the Next Terms and Identifying the Type of Sequence