I have a recursive function for which I need the values for n=1 through about n=100,000,000 (or more). The function looks as follows, with output of the form ({x,y},a), and f, g, and h some functions.
coordinates[n_]:=coordinates[n]={{coordinates[n-1][[1]][[1]] +f[n, coordinates[n-1][[2]]], coordinates[n-1][[1]][[2]]+g[n, coordinates[n-1][[2]]]}, coordinates[n-1][[2]]+h[n]}
I then compute:
Table[coordinates[n][[All,1]], {n, 100,000,000}.
I can get up to a few million with about 4 hours of calculation time, but 100,000,000 causes my computer to crash and restart, stating "kernel panic" (I am not very familiar with programming unfortunately). Any advice about how to make such a table more easily calculated would be much appreciated!
coordinates[n_]
where is n actually being used in the calculation? Also, you say f and g are functions but they have parentheses rather than square brackets. In the Wolfram Language, arguments to functions should be surrounded by square brackets. Is it possible to post f and g, or are they very long? $\endgroup$coordinates[[1]][[1]]
supposed to refer to? Should they be something likecoordinates[n-1][[1,1]]
? $\endgroup$