Find limit of recursion: Difference between revisions

Content added Content deleted
(Pari/GP)
(→‎{{header|J}}: briefer using adverse)
Line 372: Line 372:
This assumes that all stack frames must be the same size, which is probably not the case:
This assumes that all stack frames must be the same size, which is probably not the case:


<lang J> $:@>:@]@(1!:2&2)1</lang>
<lang J> $:@>: ::] 0</lang>


Note also, that ^: can be used for induction, and does not have stack size limits, though it does require that the function involved is a mathematical function -- and this is not always the case (for example, Markov processes typically use non-functions).
Note also, that ^: can be used for induction, and does not have stack size limits, though it does require that the function involved is a mathematical function -- and this is not always the case (for example, Markov processes typically use non-functions).