I am having trouble simplifying a summation I created. Let $S$ and $b_1$ be positive integers and the only given values. If you want to work out an example, have $S=5$ and $b_1 \geq 6$. Let $l(b_i, b_{i+1})$ be a function that outputs a positive integer.
$$\sum_{b_2=S}^{b_1-1} \left[l(b_1, b_2) \times \sum_{b_3=S-1}^{b_2-1} \left(l(b_2, b_3) \times \sum_{b_4=S-2}^{b_3-1} \left(l(b_3, b_4) \times \sum_{b_5=S-3}^{b_4-1} l(b_4, b_5) \right) \right)\right]$$
The problem is that the values in the index of one summation is necessary for the index of the next summation. It's similar to $\sum_{i=1}^{5}cx$, but $c$ is a summation instead of a given constant. Not only that, but I'm not completely sure it could be simplified, shown in the apparent inability to simplify $\sum f(x)g(x)$ (Sigma Notation, Multiplication). I looked at a few resources, like Rules of Double Sums and another question that listed many properties that I am having trouble finding again, but they offered little guidance.
I wrote out an example for $b_1=7$ to find another interpretation, yet this did not help at all. I thought about $$\prod_{i=1}^{S-1}\left[\sum_{b_{i+1}=S+1-i}^{b_i-1}l(b_i,b_{i+1})\right]$$ but that simplifies to $$\sum_{b_2=S}^{b_1-1} l(b_1,b_2) \times \sum_{b_3=S-1}^{b_2-1}l(b_2,b_3) \times\sum_{b_4=S-2}^{b_3-1}l(b_3,b_4)\times \sum_{b_5=S-3}^{b_4-1}l(b_4,b_5)$$ which is close, but not quite. Each summation must finish before going to the next summation, which I do not want. For $i=2$, the upper bound would be $b_2-1=b_1-2$, as the upper bound for $\sum_{b_2=S}^{b_1-1}$ is $b_2=b_1-1$. The summation runs only once when it needs to run multiple times. What can put me on the right track?
P.S.: I am excluding some information regarding the sums for conciseness. I do not think they subtract much from the fundamental issue.
EDIT (1): It turns out that this more complicated than I thought. I will consider changing my notation to what Matt Groff has, but not now. Some context about the problem. There is a video game called "Super Auto Pets" that's available on Steam for free. I thought it would be a fun and easy problem to count the number of ways your roster of pets can defeat an enemy's roster. My equation stated at the top is only part of one term (five in total) that counts the rosters we can win against when you have one pet, not considering pet abilities. You can have a maximum of five pets, so this is the beginning.
I began my adventure on January 2, 2022, at 12:50 pm (I date and time everything). From January 10 onward, I've been working exclusively on this. Yes, it took me a month to find the top equation. Now, more information.
The "function" $l(b_i, b_{i+1})$ is actually the sequence (source: Notation for sequences) $$l(b_i, b_{i+1}) = \left< \frac{b_i-b_{i+1}}{c_i} \in \mathbb{Z}: b_{i+1} \in [S+1-i, b_i-1], c_i \in [1, 50]\right>.$$ When creating a sequence, you choose only one $b_{i+1}$ and then concatenate all the integers $c_i$. For example, if $b_1=7$, the sequence becomes
$$l(7, b_{2}) = \left< \frac{7-b_{2}}{c_i} \in \mathbb{Z}: b_{2} \in [5, 6], c_i \in [1, 50]\right>.$$
It generates the following sequences:
$$l(7, 5) = \left< \frac{2}{c_1} \in \mathbb{Z}: b_{2}=5, c_1 \in [1, 50]\right>$$ $$l(7, 6) = \left< \frac{1}{c_1} \in \mathbb{Z}: b_{2}=6, c_1 \in [1, 50]\right>.$$
Writing out the sequences ($\phi$ is the empty set):
$$l(7, 5) = \left< \{2\}_{c_1=1}, \{1\}_{2}, \phi_{3}, \phi_{4}, \dotso, \phi_{50} \right>$$ $$l(7, 6) = \left< \{1\}_{c_1=1}, \phi_{2}, \phi_{3}, \phi_{4}, \dotso, \phi_{50} \right>.$$
Also, I'm not summing up the terms of the sequence. Rather, I'm summing the length (cardinality?) after the following operation:
$$|l(b_i, b_{i+1})-\left< \phi_{1}, \phi_{2}, \phi_{3}, \dotso, \phi_{50}\right>|.$$
When I'm subtracting, I mean the set difference, of a sort. Compare the $c_1$'th term of $l(b_1,b_2)$ and $\{\phi_{c_1}\}_{c_1=1}^{50}$. Then say "From the sequences $A$ and $B$, include the elements of $A$ that are not in $B$ at position $c_1$". So $\phi_{5}-\phi_{5}$ does not equal any mathematical object besides $\phi_{5}-\phi_{5}$, even $0$, $\phi$ and possibly $\phi_{6}-\phi_{6}$. It's like trying to simplify the number $0$. In fact, it destroys anything in that position, including the position itself. It's not mathematically accurate, but it's what I have. I'm trying to remove any instance of $\phi$. Continuing from my example,
$$|\left< \{2\}_{c_1=1}, \{1\}_{2}, \phi_{3}, \phi_{4}, \dotso, \phi_{50} \right>-\{\phi_{c_1}\}_{c_1=1}^{50}| = |\left< \{2\}_{c_1=1}, \{1\}_{2} \right>| = 2$$ $$|\left< \{1\}_{c_1=1}, \phi_{2}, \phi_{3}, \phi_{4}, \dotso, \phi_{50} \right>-\{\phi_{c_1}\}_{c_1=1}^{50}| = |\left< \{1\}_{1} \right>| = 1.$$
Observe that the result is always an integer. This is what I meant when I said, "Let $l(b_i, b_{i+1})$ be a function that outputs a positive integer." Hopefully this answers Matt Groff's question about the type of "function". I'm also worried about how I should finish my project, as I start college on Monday, January 31. I probably need six months, at least.
P.S.: Should I add the combinatorics tag?