These things are far easier than you think. In fact, there are (at least) two simple ways to solve it.
Generate multiple sets of 5 numbers. Throw away any that fail the requirements, and then keep the first 100 that make you happy. With only 5 numbers, it won't take that much ovesampling to meet the goals.
R = randi(4,[500,5]);
R(any(diff(R,,2) == 0,2),:) = ;
R = R(1:100,:);
As you can see, 500 was about 50% larger of an over-sample than I needed here. If your goals were more stringent, then you would need to do more over-sampling. If the over-sampling was taking too much time, then switch to the second option, here:
Option 2 is to just use a loop. Generate the first number as anything from 1-4. Then choose the second number as anything that is not a repeat of the number that precedes it in the list. There is no oversampling required here, just a simple loop. The nice thing is, this will work for ANY set of numbers, of any length. So if you needed sets of 10000 numbers that do not repeat, it is trivial to write.
The point is, either of those ways is trivial to write. Perhaps you think there is some absolutely obvious vectorized way that you are failing to see. (In fact, it looks like there is, as pointed out by Stephen, reflecting a line of code I wrote some time ago.) But the point is, you are over-thinking the problem, looking for some magical solution that does what you want in one brilliant line of code, while tearing your hair out in not seeing it. Your code does not need to be brilliant. It needs to be functional, while not wasting your time in trying to write it.