# Super recursive function

I have read about how to define a recursive function using RecurrenceTable but for $u(100)$ you need all 99 previous terms. The posts doesn't help me. I want to define in mathematica this function:

$$u(n) = u_0 + \frac{\mu}{\Gamma(\nu)} \sum_{i=1}^n \frac{\Gamma(n-i+\nu)}{\Gamma(n-i+1)} u(i-1)(1-u(i-1)),$$ where $\Gamma(x)$ is the Euler gamma function and $\mu$ and $\nu$ are positive numbers.

Can anybody help me?

Unless the values for {u, μ, ν} are small, an overflow tends to occur.

SeedRandom;

ν = RandomReal[{1/10, 2}, WorkingPrecision -> 50];
μ = RandomReal[{1/10, 2}, WorkingPrecision -> 50];

Clear[u]

u = RandomReal[{1/100, 1}, WorkingPrecision -> 50];

u[n_Integer?Positive] := u[n] =
u + μ/Gamma[ν] Sum[
u[i - 1] (1 - u[i - 1]) Gamma[n - i + ν]/Gamma[n - i + 1], {i, n}]

u

(*  1.000082  *)

• Your code works perfect. But now,I want to draw a bifurcation diagram of u in terms of $mu$. I know I should define a function of $n$ and $mu$. It would be u[n_Integer?Positive,mu]?? Lot of thanks – Dog_69 May 29 '17 at 20:36
• No, it would be u[n_Integer?Positive, m_] := u[n, m] = ... – Bob Hanlon May 29 '17 at 21:19
• Yes I forget the "-" but I had this idea. Thanks. – Dog_69 May 29 '17 at 21:35

The possible implementation would be something like:

u[n_, nu_, mu_] :=
u[n, nu, mu] =
u0 + mu/Gamma[nu]*
Sum[Gamma[n - i + nu]/
Gamma[n - i + 1] u[i - 1, nu, mu] (1 - u[i - 1, nu, mu]), {i, 1,
n}]

• I have tried this implementation, but for n=20 the time is longer. – Dog_69 May 29 '17 at 18:58