MathGroup Archive 1993

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

Search the Archive

Recursive function definition

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Recursive function definition
  • From: Joseph G. Mcwilliams <mcwilljg at euler.sfasu.edu>
  • Date: Wed, 22 Sep 93 15:21:13 -0500

I wish to define a recursive function with conditional special cases:

f[n_, a_] := f[n-1,a] + f[n-1,a - n]  


subject to: (1) f[n,0] = 1
		     (2) If a<0 then f[n,a] = 0
		     (3) If a >= n (n-1)/2 then f[n,a] = f[n,n(n+1)/2]

Can anyone help me with this?  Thanks.

---
Joseph McWilliams
mcwilljg at euler.sfasu.edu





  • Prev by Date: MathSource: What's New 9/15 (long)
  • Next by Date: "Leaky" ceiling
  • Previous by thread: MathSource: What's New 9/15 (long)
  • Next by thread: "Leaky" ceiling