Using tree's branch index in calculation

Hi all, I am new to this forum and grasshopper
so I have this list:
{0;1} 0
{0;2} 0
{1;1} 0
{1;2} 0
{1;3} 0
{2;1} 0
I want to use the branch index in calculation like {x;} * 10 + {;x} so that it will create:
{0;1} 1
{0;2} 2
{1;1} 11
{1;2} 12
{1;3} 13
{2;1} 21
this is only a gross simplification of my problem
so far I’m using c#, I tried to look online but can’t find anything yet
anything would help!
also, if anyone know how to read data tree in c# I’d be grateful

EDIT: I finally found out, apparently it’s called indice, not index
this is the code that I used
x being the level of the indice in the tree

indice1 = tree1.Path(i).Indices;
and apparently this is how you access data in tree, although I don’t really get it
data = tree1[tree1.Path(7), 0];

SN

Hi Nhoangson1995,

Here a Grasshopper and a C# solution. For more complex datatree structures, you need to figure out the logic.
add_indices.gh (18.3 KB)