For $(1,2,2,3,4,4,4)$:
$\left\{\{(1,1,1)\},\\ \{(1,1,1), (2,2,1)\},\\ \{(1,1,1), (2,2,2)\}, \\
\{(1,1,1), (2,2,2), (3,3,1)\},\\
\{(1,1,1), (2,2,2), (3,3,1), (4,4,1)\}\\
\{(1,1,1), (2,2,2), (3,3,1), (4,4,2)\}\\
\{(1,1,1), (2,2,2), (3,3,1), (4,4,3)\}
\right\}$
First positions of triplets determines the index of same-number sequence, the second one - an element generating this sequence, the third one - the length of the sequence.
To show the idea, create a set for $(1,1,2,1,4,4,8)$:
$\left\{
\{(1,1,1)\},\\
\{(1,1,2)\},\\
\{(1,1,2), (2,2,1)\},\\
\{(1,1,2), (2,2,1), (3,1,1)\},\\
\{(1,1,2), (2,2,1), (3,1,1), (4,4,1)\},\\
\{(1,1,2), (2,2,1), (3,1,1), (4,4,2)\},\\
\{(1,1,2), (2,2,1), (3,1,1), (4,4,2), (5,8,1)\}
\right\}$