Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Finding length in recursive definition?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60877] Finding length in recursive definition?
  • From: "Jose Reckoner" <reckoner at gmail.com>
  • Date: Sat, 1 Oct 2005 02:55:52 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I have something like:
f[1] = 1
f[2] = 3
f[n_] := f[n] = f[n - 1] + f[n - 2]

and in the course of work, f[n] gets evaluated an unknown number of
times resulting in

>> ?f
f[1] = 1
f[2] = 3
f[3] = 4
f[n_] := f[n] = f[n - 1] + f[n - 2]

I want to figure out the greatest integer n such that f[n] has already
been computed and is stored. In this case, it is 3.

How can I do this?

Thanks!

Jose


  • Prev by Date: Minimizing an integer value function
  • Next by Date: mole units
  • Previous by thread: Re: Minimizing an integer value function
  • Next by thread: Re: Finding length in recursive definition?