I have a function f
with two integers as input arguments, and I need to create a table iterating on those input arguments. One of the properties of the function, is that f[i+1,j]
is dependent on f[i,j]
, with this holding true for the 2nd argument as well, i.e in a table I can use the value positioned to the left or above to calculate the subsequent value.
Is there an elegant way of using the previous values of a table while it is being created (in one line without leaving Table[]
),initiate C[[0,0]]=f[0,0]
and define g[p_,q_]
that uses the previous values and its own position?
Why do it like this? f
is computationally expensive, using previous values will reduce greatly the number of operations needed.
Why not use functions that remember values they had found? The output of f
will take lots of space. I do not want to have two copies, one remembered by the function, and one in the table I am generating.
Thank you for your replies!
RecurrenceTable[]
? $\endgroup$