# Questions tagged [recursion]

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

493 questions
Filter by
Sorted by
Tagged with
33 views

### Getting NSum to go to the right depth in recursive definitions

I wanted to produce some plots of the action of the Gauss shift map on cumulative distribution functions. This means I wanted to plot functions $F_n(x)$, for $0 \leq x \leq 1$, defined by $F_1(x) = x$ ...
115 views

### Find the square root using a recursive formula [closed]

I want to approximate the square root x=Sqrt[a] for $a>0$ using the the formula $x_{n+1}=\frac{1}{2}(x_n+a/x_n)$. How can I do this?
37 views

### RecurrenceTable: numercial exception

When I added vector b into expression, it returned with RecurrenceTable::excptn: Value {2/3,-(1/3),2/3,-(1/3)} is a numerical exception. ...
77 views

### How to assign a constant value in a recursion relation

I use the code ...
409 views

### Slow computation of recursive sequences

I want to investigate the asymptotic behavior of the following recursive system: ...
54 views

### Mistake in recursive algorithm

I am new to Wolfram, and I am trying to make a recursive Archimedes algorithm in Wolfram. I read documentation and I tried to run this code ...
83 views

### Implement a recursive formula with internal sum

I need to calculate following recursion formula. I implemented this in MATHEMATICA as follows: But it always gives errors for $k>0$. Can someone help me to implement this? ...
58 views

### What is the fastest way to calculate series from recurrence solutions with no closed form?

I am not very experienced with Mathematica. I want to calculate the series from recurrence solutions. These solutions have no closed-form. I want to improve the approximation and hence need a good ...
35 views

87 views

### Recursive solution to the extended Josephus problem [duplicate]

The Josephus Problem is described here, with extension of killing every $k$th problem. In the simple case where every other person is killed, we can also use the binary trick. ...
137 views

107 views

### Speeding Up Recursive Evaluation

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. ...
89 views

### RSolve and a Piecewise Recurrence + Runtime

This should really be a comment to this answer but I don't have enough rep. I'd like to know how to do the same thing (efficiently - see below) but with $\mod 3$ conditions, i.e. define a[k] to be the ...
59 views

### Is there a way to get values from a set of functions with circular dependencies? [closed]

I am using the following code to find iteratively the functions $\Sigma(r)$, $h(r)$ and $T(r)$ ...
### Mathematica code for computing the $p$-adic expansion of rational numbers
Does anyone know any Mathematica code for computing the $p$-adic expansion of rational numbers? I.e. given a rational number $a/b,~a,b\in \mathbb{Z}$ and a prime number $p$, then compute the $p$-adic ...