Partial sums: formula for nth term from partial sum