MathGroup Archive 2008

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

Search the Archive

Re: Problems with recursive function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87401] Re: Problems with recursive function
  • From: Frank Hechtner <frank.hechtner at rub.de>
  • Date: Wed, 9 Apr 2008 05:58:15 -0400 (EDT)
  • References: <200804080939.FAA12146@smc.vnet.net> <ftfk9u$fb4$1@smc.vnet.net>

Thank you for the hint. That was exactly what i?m looking for.

kind regards from germany

frank

> Hello Frank, try this:
> 
> test[0, _] = test[0] = test0
> 
> test[0, foo]
> 
> On Tue, Apr 8, 2008 at 5:39 AM, Frank Hechtner <frank.hechtner at rub.de>
> wrote:
> 
>> Dear Newsgroup,
>>
>> I'm in trouble with a recursive function. the functios looks similar to
>> test[a_, b_] := test[a - 1, b]*b. A is the index b should just be an
>> argument of test.
>> for any calculation i need to tell mathematica the first value of the
>> function, e.g. test[0, 5]=5. The problem is the following: the first
>> object is independent of b. does anyone know a way to tell mathematica
>> the following thing:
>>
>>  test[0,b]=5 => test[0]=5 regardless to b.
>>
>> Thanks for your help.
>>
>> Frank
>>
>>
> 
> 


  • Prev by Date: How does NETLink find MathKernel.exe?
  • Next by Date: Re: Just primitive ColorFunction
  • Previous by thread: Re: Problems with recursive function
  • Next by thread: Re: Problems with recursive function