Skip to main content

Questions tagged [recursion]

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

0 votes
0 answers
46 views

How to Set Precision for an RSOLVE Problem

The following code was working fine -- now it produces errors. I originally built this in ver 13.1 and I'm now running ver 14. I think I'm getting machine precision errors after k=11 that were not ...
1 vote
3 answers
212 views

Finding a sequence with RecurrenceTable

I would appreciate if somebody could help me with the following problem: Q: How can the following recursion equations be solved using RecurrenceTable? $\...
0 votes
3 answers
85 views

RecursionLimit error appearing if solve the recursion formula

...
2 votes
2 answers
46 views

How to fix parameter locally for iterating recursion equations

The following is a simplified version of a more detailed problem. I have two coupled recursion equations of two variables, x and y. One equation also depends on a parameter, c: ...
4 votes
6 answers
341 views

Adding non adjacent elements in a list

I've been stuck on a simple problem for a while. Let's say you have a list of any length: {a,b,c} How do you recursively add the first and last element of the list ...
5 votes
3 answers
809 views

Writing a program that divide numbers until I hit a one digit number

Well, I have the following question: How can I write a program such that an input number $n$ is divided by the number $k$ as long as the resulting number does not have one digit, if the resulting ...
0 votes
0 answers
57 views

Return[] in Recursive Functions [duplicate]

Here is the pseudocode I am using to demonstrate the problem. ...
1 vote
2 answers
118 views

RecurrenceTable vs For loop : they do not give the same results. Why?

I have a second-order recurrence equation that I want to plot. I've used two different methods. The first uses RecurrenceTable, the second uses a traditional ...
1 vote
1 answer
89 views

Most efficient way of defining the following sets for every step $n$

For each $n\in\mathbb{N}$, how do we compute sets $A_n$ and $B_n$ below: Let $A_1=[0,2/3)$. Let $B_1=(2/3,1]$. If $A_n$ is a union of intervals, then for each interval cut out the middle $1/2^{n+1}$ ...
5 votes
6 answers
163 views

Create a list that always ends with two 1's but starts with a variable amount of 0's

I want to create a variable list like this: {0, 0, ..., 0, 0, 1, 1} This list would grow list this, starting with no 0's, but then gaining more 0's to the left the ...
3 votes
2 answers
61 views

RSolve does not evaluate this recursion with two boundary conditions

I am using RSolve to solve for a function defined recursively, with two boundary conditions: First boundary condition describes the relationship between $f(1)$ and $f(0)$ Second boundary condition ...
2 votes
1 answer
86 views

Problem with RecurrenceTable of two variables

Let we have simple recursive function: ...
1 vote
1 answer
41 views

Strange errors of exceeding RecursionLimit in a function with two arguments, one set delayed and one fixed

INTRODUCTION Hi. I feel a bit embarrased asking this question as the answer may be staring me in the face and there are at least two other stackexchange articles related to it. MINIMAL WORKING EXAMPLE ...
5 votes
2 answers
177 views

How to implement If criteria for the NestList-Function

I have a function which bisects a list in two parts recursively. Unfortunately I have to select a number of iterations for the NesList-function which is just an ...
2 votes
1 answer
74 views

Root finding for holomorphic functions, II

This is a follow-up to my question Root finding for holomorphic functions. I am trying to compute $10^6$ zeros of the derivative of the Riemann zeta function $\zeta(s)$ in the critical strip near ...

15 30 50 per page
1
2 3 4 5
44