Roll a die times. Face can appear at most times consecutively. Count valid sequences. State: = sequences after rolls, last face is , with repeats. Transition: if new face differs, reset consecutive to 1.
If same face, increment consecutive (if within limit). improvement: instead of tracking consecutive, track = sequences ending with . Subtract invalid extensions.