MathGroup Archive 2012

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

Search the Archive

Functions That Remember Values They Have Found

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127601] Functions That Remember Values They Have Found
  • From: Esteban González Morales <yo8231 at gmail.com>
  • Date: Mon, 6 Aug 2012 04:37:28 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hi, I was trying to create a recursive function and I read the help about it, and wrote this code

Hgeom[n_] := 
 H[n] = Sum[(1 - 0.5)^i/(1 - 0.5^i) Hgeom[n - i], {i, 1, n}]/n
Hgeom[0] = 1;

However, when I calculate Hgeom[10] it gives me the right value, and then I ask for the information about Hgeom and get that it has values calculated.

Have you any idea what could have gone wrong?



  • Prev by Date: Re: any news of new edition of The Mathematica GuideBooks?
  • Next by Date: Re: Problem finding maximum
  • Previous by thread: Re: Simplifying expressions using rules with recursion
  • Next by thread: Re: Functions That Remember Values They Have Found