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