recurrence relation of algorithms