Next term and rule for nth term