MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: calculate Recurrence Equations


Frank Hechtner wrote:
> hi,
> 
> i?m in trouble with my Recurrence Equations:
> 
> i?ve defined the following function
> 
> anteil[0] = 1
> anteil[n_] := anteil[n - 1] + (anteil[n - 1]*5 - 1)/100
> 
> i want mathematica to calculate the values for anteil[30] and so on.
> 
> Unfortunately mathematica needs for this calculation over 2 hours (and 
> is still running, athlon x2 4600, 2 gb ram).

Hi Frank,

The following definition should help:

  anteil[0]=1;
  anteil[n_]:= anteil[n]= anteil[ n-1]+ ( anteil[ n-1]*5-1)/100

anteil[30]
--> 
4909085745117164100520051333566036654601/1342177280000000000000000000000000000000

See "Functions That Remember Values They Have Found"
http://documents.wolfram.com/mathematica/book/section-2.5.9

HTH,
Jean-Marc


  • Prev by Date: RE: Several functions in a single 2D-plot
  • Next by Date: Re: Several functions in a single 2D-plot
  • Previous by thread: Re: calculate Recurrence Equations
  • Next by thread: Re: calculate Recurrence Equations