Questions tagged [recursion]

Recursion is the process of repeating items in a self-similar way. A recursive definition (or inductive definition) in mathematical logic and computer science is used to define an object in terms of itself. A recursive definition of a function defines values of a function for some inputs in terms of the values of the same function on other inputs. Please use the tag 'computability' instead for questions about "recursive functions" in computability theory

Recursion is the process of repeating items in a self-similar way. The most common application of recursion is in mathematics and computer science, in which it refers to a method of defining functions in which the function being defined is applied within its own definition.

Basically, a class of objects exhibiting recursive behaviour can be characterised by two features:

  • There must be a base criterion for which the function should not call itself.

  • Every other iteration of the function should move it closer to the base condition.

2553 questions
14
votes
2 answers

Property of a recursive integer sequence

Loosely related to this question, I encountered a recursive sequence of integers $(b(j,n))_{j\in\mathbb Z,n\in\mathbb N}$ given by $$ b(0,1)=-1\qquad b(j,n)=0\text{ if }j<0\text{ or }j\geq n\\ b(j,n+1)=b(j,n)(2j-n)+b(j-1,n)(2j-3n-1)\text{ for all…
13
votes
2 answers

Finding expected value with recursion

We'll start off with an example of a question of finding expected value. What is the expected number of tries to get $6$ when rolling dice? $$ \mathbb{E}[x] =1/6*1 + 5/6 * (1+\mathbb{E}[x]) \implies \mathbb{E}(x)=6 $$ I understand the intuition,…
hans-t
  • 387
  • 1
  • 3
  • 12
13
votes
3 answers

Find $f(f(\cdots f(x)))=p(x)$

$\newcommand{\nest}{\operatorname{nest}}$Let's define a function $\nest(f, x, k)$, which takes a function $f$, an input $x$, and a non-negative integer $k$, and calls $f$ on $x$ repeatedly ($k$ times). For example, $$ \nest(f, x, 0) = x\\ \nest(f,…
13
votes
1 answer

Prime Foias constant

It is a known fact that there is the unique constant for which the terms of recursion $$x_{n+1}=(1+\frac{1}{x_n})^n, x_1=\alpha$$ tend to infinity (for other values we start jumping around). The value is known as the Foias constant…
user318107
13
votes
4 answers

What is the solution to the following recurrence relation with square root: $T(n)=T (\sqrt{n}) + 1$?

This looks like a question asked earlier, but it isn't. $$T(n)=\begin{cases} T (\sqrt{n}) + 1 \quad & \text{ if } n>1 \\ 1 & \text{ if }n=1\end{cases}$$ My professor gave this to me in class yesterday. This is where I'm stuck: $$T(n) = …
GrowinMan
  • 375
  • 2
  • 3
  • 11
13
votes
1 answer

Is there a name for the recursive incenter of the contact triangle?

Recently, I became aware that there are many more triangle centers than the four I learned about in school. This reminded me of a thought I had when I first learned about the incenter: what point would you get if you took a triangle of the three…
Random832
  • 493
  • 2
  • 10
12
votes
2 answers

The set that only contains itself

Ignoring the axiom of regularity (and therefore the implication of "no set can contain itself"), would it be correct to state that the set that contains only itself is unique? My argument is that if $x$ is said set, then $$ x = \{x\} = \{\{x\}\} =…
Disousa
  • 1,254
  • 1
  • 10
  • 17
12
votes
2 answers

How to prove this recursive sequence converges to $\sqrt 2$?

Let $a_0,a_1>0$ be given. Consider the recursive sequence $$a_{n+2}=\frac{1}{a_{n+1}}+\frac{1}{a_n}$$ Prove that $a_n\to\sqrt2$. I attempted to find a bound for $a_n$ but so far I have only got $a_n>0$. Somebody hints that I might want to use…
Vim
  • 13,065
  • 4
  • 25
  • 71
12
votes
2 answers

Primitive recursion and $\Delta^0_0$

Until recently I assumed that primitive recursive relations are exactly $\Delta^0_0$ (i.e. bounded) ones, but I learned they're different (the former is a proper superclass of the latter). I have questions regarding the difference between the…
Pteromys
  • 7,240
  • 4
  • 28
  • 62
11
votes
4 answers

Is there a recursive formula for Euler's Totient function

I have been looking for a recursive formula for Euler's totient function or Möbius' mu function to use these relations and try to create a generating function for these arithmetic functions.
11
votes
1 answer

How many ways to seat $n$ couples so that each husband's neighbors can only be his wife or another gentleman?

How to seat $n$ couples (husbands and wives) in a line so that each husband's neighbors can only be his wife or another gentleman? I.e. his neighbor cannot be another woman that's not his wife. There is a classical similar problem: In how many ways…
11
votes
1 answer

An eely function $\mu (n):\;\;\prod\limits_{k = 0}^{n - 1} {\left( {\mu (n) - \mu (k)} \right)} = 1$

Time ago, dealing with a generalization of the Stirling numbers, I stumbled on the following implicit recurrence $$ \mu (n):\;\;\prod\limits_{k = 0}^{n - 1} {\left( {\mu (n) - \mu (k)} \right)} = 1\quad \left| \matrix{ \,0 \le n \in Z \hfill \cr…
G Cab
  • 33,333
  • 3
  • 19
  • 60
11
votes
6 answers

Evaluating tetration to infinite heights (e.g., $2^{2^{2^{2^{.^{.^.}}}}}$)

The Problem How can you evaluate (i.e., get a value for) Tetration (i.e., iterated exponentiation) to infinite heights? For example, what would be the value of this expression? $$ 2^{2^{2^{2^{2^{.^{.^.}}}}}} $$ My (pathetic) Attempts I tried…
11
votes
1 answer

Find $ ? = \sqrt[3] {1 + \sqrt[3] {1 + 2 \sqrt[3] {1 + 3 \sqrt[3] \cdots}}} $

I wonder about a closed form for $ ? = \sqrt[3] {1 + \sqrt[3] {1 + 2 \sqrt[3] {1 + 3 \sqrt[3] {1 + 4 \sqrt[3] {1 + 5 \sqrt[3] \cdots}}}}} $ To be clear $$? = \sqrt[3]{ 1 + \color{Red}{1}\sqrt[3]{ 1 + \color{Red}{2} \sqrt[3]{ 1 + \color{Red}{3}…
mick
  • 12,920
  • 3
  • 28
  • 85
10
votes
1 answer

Prove that $a_n$ is a perfect square if $n$ is even without generating functions or Taylor series.

Let $a_n$ be the number of positive integers whose digits are all $1$, $3$, or $4$, and add up to $n$. For example, $a_5 = 6$, since there are six integers with the desired property: $41, 14, 311, 131, 113$, and $11111$. Prove that $a_n$ is a…
heyhuehei
  • 669
  • 5
  • 15