Constraint number of occurrences in dynamic array

In reply to dave_59:
sure.
i can have 2, 3, 4, 5 values in an array
i randomized that using
foreach arr[i] arr[i] inside {2,3,4,5}
now i want to have atleast N number of value as 2
for example,
arr can have 4 times 2, 3, 4, 5 value as an element.
what i want to do is restrict the count of 2, 3… to 4 times.
another condition is they should not be consecutive which is fine.
i can add another constraint saying
Arr[i] != Arr[i+1]
but i am not sure how to put constraint on occurrence of a value/or total number of count on how many times the value shall exists in array ?
does that makes sense ?

basically i want to have
Arr = {2,3,4,5,2,4,3,2,3,5,3,2,4,5,4,5,3,4} ; – here i want to limit 2,3,4,5 shall exists atleast 4 times it can be more than that(like 3 and 4 .