visit_sequence function

Generate a visit sequence.