Next terms in a sequence