# Tagged Questions

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

340 views

### Mimic a procedural, recursive clustering algorithm for site percolation using functional programming

Sorry in advance for my logorrhea: I just want to make sure all of the information is here. Context and Question I am investigating site percolation on a square lattice. I have a working, depth-...
126 views

### Closed form of two-layer recurrence

I am trying to find a closed-form expression for $A(0)$, described by the following recurrence forms, as a function of $L$ and $d$: \begin{align} A(\ell) &= 1 + 2^d A(\ell+1) + \sum_{g=0}^{d-1} \...
114 views

72 views

### How to build recursive function which only remembers every pth value and the last two values?

I need to create a recursive function of the natural numbers $f$ which only remembers the last two values it has found and every $p$th value. Below is the form of the code that I am working with, but ...
274 views

### Recursive Euclidean algorithm in Mathematica

Can anyone explain to me how do I use a recursion, if I don't know the limit? For example, I need the remainder $r$ of the Euclidean algorithm for $\gcd(a,b)$ which equals $0$. I figured out that the ...
63 views

### Evaluate recursive funtion as a whole before computing a recursive step

I'll try to make a basic example of my problem with $n$ being an array of elements, ex. $\{1,2,2,3,3,3\}$: If i have a sum which needs a computed value i would like to compute it beforehand and store ...
349 views

### Usage of Piecewise/RSolve to solve an equation based on condition

I am trying to compute price of call option on a stock using the finite difference method. I have a VBA code for it, and I am trying to find out how I can use Mathematica memoization functions and ...
127 views

### Using Mathematica to solve a recursive system of differential equations [closed]

I believe I have a difficult problem to work on specially because I don't have any previously experience using Mathematica in this kind of situation. So I'll try to describe it as best as I can hoping ...
46 views

### Using Nest on a function that takes a function as one of its arguments [closed]

I have a function, nS[f_, xk_], which takes as arguments a function f and a vector xk. It ...
313 views

### Can RecurrenceTable make use of CompiledFunction?

I'm trying to implement a discrete-time 2D Verlet algorithm for a point-mass subject to a softened gravitational interaction as a test for a more computationally intensive simulation using ...
130 views

### Computing a recurrence table backward

I am trying to understand how to compute a recursive equation backward say n = 10 to n = 1. I am trying to solve a PDE for which ...
80 views

51 views

### Index change in a recursive definition

Assume I have the following recursive definition: ...
133 views

226 views

### Recursive functions taking list arguments

I wish to create a function that takes lists (e.g. {plus,plus,minus,0,minus,plus}) and uses the input list to calculate a corresponding value using a set of ...