# Questions tagged [recursion]

For questions about defining recursive functions, recursive algorithms and solving recursive equations.

646 questions
Filter by
Sorted by
Tagged with
75 views

### How is my code going over the recursion limit?

I don't know how my code is exceeding the recursion limit of 1024. ...
75 views

### Recursion not working for higher terms

I am trying to find the terms x9,x10,x11 and y6,y7,y8 and so on from the recursive relation given in the code. ...
175 views

### Sorting a list of functions by exploiting the recursive structure

Given a list of functions list and a vector of arguments {t, a}: ...
134 views

### Symbolic recursion

I have the two recursive relations: ...
105 views

### Calculate Bernoulli numbers ( with a twist) [closed]

Mathematica has an inbuilt function BernoulliB that calculates $B_n$ for which, $$\frac{t} {\left(e^t-1\right)}=\sum_{n=0}^{\infty} \frac{B_n}{n !}t^n$$ I need to ...
1 vote
70 views

### Understanding HoldFirst in QuickSort algorithm

I have read the implementation of QuickSort algorithm in WL from Roman Maeder's Computer Science with Mathematica (2000). The implementation is shown below. ...
127 views

### Recurrence formula evaluating with speacial counting of subscripts

Hoping to check some recurrance relationship like this $a_1 = x$ and $a_2 = y$, with $$a_{2n+1} = a_{2n} a_{2n-1}$$ and $$a_{2n+2} = a_{2n+1} + 4$$ Tried ...
104 views

### Optimization of a Markov сhain with symbolic transition rate

I am trying to work on 1D random walk that can move to left, right or stay with probabilities $p_i$,$q_i$,$r_i$ that changes with the site $i$. I am trying to simulate this by using a recurrence ...
1 vote
156 views

### How do you Solve a Simultaneous System of Recursions

Consider the following system of simultaneous recursions: r[n] == s[n-1] s[n-2] == r[n-3] I am tring to solve this system (I have given a vastly simplified ...
1 vote
70 views

### Recursively applying a substitution

I have an expression like this: 2v[j-1]-(s[j]+1)(c[j]-c[j-1]) >= v[j] I want to apply this recursively say k times. I can do one step like this: ...
120 views

36 views

1 vote
86 views

### SummaryBox and Recursion

How can I make it so that what is under the dropdown block is not calculated/constructed at once? Example code: ...
153 views

### Recursive function with subscript

I am trying to define a recursive function with a subscript. Something similar would be $f_{n+1}(x) = \int 3 x f_{n}(x)dx$. I've tried lists, For function, ...
1 vote
88 views

### A recursion in a sum [closed]

I wish to use a recursion to continue the updating n2, n3, etc., up to n30. Probably simple concept for an experienced MM user. Sorry. ...
74 views

### Use two derivative rules and iterate several times to get the simplest expression of higher derivative

I have 2 rules of recursive relation of the derivative, I want to use it several times get the higher derivative on [\Theta] of ...
61 views

### Recurrent equation with UnitStep function using RSolve

I have the following equation to solve $$a[n+1] = a[n] + 6 - 100\cdot \theta(a[n]-100)$$ where $\theta(x)$ is the Heaviside step function. So I tried the following ...
131 views

### Kernel crashes after long iterations

I am trying to get a numerical root of a function defined as below. But after some large recursion the kernel get crashed. But for relatively low recursion(10000) that does not make any problem. But I ...
1 vote
98 views

### Module returning Null even with Module as a Return parameter

I'm currently trying to implement Newton's method of approximating roots to approximate the root of 2. I looked into some possible reasons as to why it would return Null, such as the scope of the ...
605 views

### V 13.2 gives TerminatedEvaluation["RecursionLimit"] on code which works before. Why?

Update June 25, 2023. Problem still there in V 13.3. Added screen shot at end. I was trying code which worked all the time: How to extend a function by period and display it I find that in V 13.2 it ...
78 views

### Problem with For Loop when evaluating a recursive function at multiple points

I am running into problems with my For loop when trying to evaluate my expression. Fix some parameter values : ...
439 views

### Plastic number rectangle

I'd like to find a nice recursive way of making this image based on the plastic constant Here's a start ...
221 views

### Recursive function Catalan triangle

I'm trying to learn how to build a recursive function. However, I'm not sure to understand how to set a "limit". Here is what I'm trying to make. I want a function that gives me the i,j ...
1 vote
137 views

### Speed up calculation of recursively defined list

I have two lists $a$ and $b$ of length $n$ and $n-1$ respectively (typically I have $n \approx 1000$). I have to compute a list $\theta$ of length $n$ which is defined recursively by the following ...
101 views

276 views

### How to create a sequence of functions defined recursively?

I'm trying to create a Table of functions where each new element is defined recursively via indefinite integration of the previous one. I've tried doing: ...
321 views

### Why does SystemPrivateConstructNoEntry[Quantity, 1, "kg"] enter a Recursion?

SystemPrivateConstructNoEntry[BesselJ, 0, x] works fine, and outputs BesselJ[0, x] However, ...
1 vote
81 views