I'm trying to generate a random sequence of integers whereby no two consecutive values are equal to each other. This sequence is meant to simulate changes in state only. Is there some term or concept which captures this idea that's already been formalized in probability?
My current approach is to generate an excess of random ints from the count I desire followed by a reduction that eliminates all the entries whose diff in the sequence is zero and further reducing to just the quantity desired should I have succeeded in yielding the necessary amount.
This related stack overflow post asks some implementation details for such on operation but I wonder if there's anything formal out there that conceptualizes this operation like a constrained random walk or something along those lines.