Greetings, StackOverflow.
Say I have the following two recurrence relations for computing S (i, j)

I would like to calculate the values โโof S (0,0), S (0,1), S (1,0), S (2,0), etc. asymptotically optimal way. A few minutes with a pencil and paper show that it unfolds into a tree structure, which can be transformed in several ways. Now this unlikely tree will be useful later, so now I am looking to create a nested list such as [[S(00)],[S(10),S(01)],[S(20),S(21),S(12),S(02)],...] . I created a function to create a flat list S (i, 0) (or S (0, j), depending on the first argument):
osrr xpa p predexp = os00 : os00 * (xpa + rp) : zipWith3 osrr' [1..] (tail osrr) osrr where osrr' nab = xpa * a + rp * n * b os00 = sqrt (pi/p) * predexp rp = recip (2*p)
However, I am losing how I move on.
source share