There are
ways of picking any two digits.
The first digit can be chosen between 1 and 4 times; the remaining positions in the sequence are occupied by the other digit. The number of ways this can happen is
Then the total number of sequences that match the criterion is
(where
)