Hello everybody,

I am having trouble of finding an index number that identifies the position of an array which is ordered as follows:

[1, 1, 1, 1] : index 1

[1, 1, 1, 2] : index 2

...

[4, 4, 6, 6] : index ?

[4, 4, 6, 7] : index ?

[4, 4, 7, 7] : index ?

[4, 5, 5, 5] : index ?

[4, 5, 5, 6] : index ?

[4, 5, 5, 7] : index ?

[4, 5, 6, 6] : index ?

...

[7, 7, 7, 7] : index ?

i.e. the numbers at later positions are always at least as high as the former ones. If the maximum value of 7 is reached the former number is increased. I am wondering what would be the right way of computing the index of one of these numbers in this presented order?

The array consists of 4 values and takes values from 1-7.

Thank you a lot for help!

Best, Rafael