I would like to better understand the double summations of which one of the sums depends on the upper limit of the previous sum. This frequently appears in the theory of representation (to the extent of my knowledge) and in some systems of physics. With representations of the form $[a,b,c]$ or even of a simpler form, it is tricky – at least for me – as I explain below.

Ideally, I would like to understand how I can effectively implement something like the following example of representations.

Consider the formula:

$$[0,p_1,0] otimes [0,p_2,0] = sum_ {k_1 = 0} ^ {p_1} sum_ {k_2 = 0} ^ {p_1-k_1} [k_1,p_2-p_1+2k_2,k_1] $$

with $ p_1 leq p_2 $.

It is essentially a decomposition of representations; each term $[a,b,c]$ is a representation to be more concrete.

Here is a minimal and non-trivial example of what he should give:

$$[0,2,0] otimes [0,2,0] = [0,0,0] oplus [0,2,0] otimes [0,4,0] otimes [2,0,2] otimes [1,0,1] otimes [1,2,1]$$

What I have implemented is the following:

```
break down[p1_, p2_] : =
Module[{x1 = p1, x2 = p2},
If[x1 <= x2,
Sum[Print[k1, x2 - x1 + 2 k2, k1], {k1, 0, x1}, {k2, 0, x1 - k1}
,
Impression["Wrong values for the p1 and the p2"]]]
```

And to achieve the above example, one must perform the simple

```
break down[2, 2]
```

If you try to execute this command, the absolute timing is $ 0,000328- you get the correct decompositions and none are missing. Once the representations are printed, I receive the following message:

```
6 Null
```

Six is the number of terms; which is great and very useful because I wanted to implement a command m indicating the number of terms that I would get after the decomposition. I understand why I receive the Null. This comes from the way I wrote the sum. However, I have not been able to solve the problem. Namely, if I polish the implementation of the sum, the code does not work.

Punchline: I wish I could run the order and get something like -for the example above-

```
There are 6 channels
000
020
040
101
121
202
```

Thank you in advance.

P.S: A little more generally, I think, is the equivalent of asking how I can ask Mma to do a summation or product in a symbolic form and not by actually calculating the traditional algebraic problem.