I think you can extend your approach of only generating sequences that start with (1,2) to only generate sequences that if you consider each digit in turn then either:
- the digit matches a previous digit
- the digit is the next unseen digit
So a sequence like (1,2)(2,1) and (1,2)(3,4) would be allowed, but not (1,2)(4,5) because the 4 violates the rules (3 is the next unseen digit at this stage).
Given this you can then generate all the combinations recursively by choosing each pair in turn, where each pair must be both a new pair, and satisfy the rules.
e.g. for k=3
(1,2) Only option for level 1
(1,2) can be followed by (2,1) or (1,3) or (2,3) or (3,1) or (3,2)
(1,2)(2,1) can be followed by (3,1) or (3,2) or (1,3) or (2,3)
(1,2)(2,1)(3,1) can be followed by...