#GolfScript - 45 38 36 characters#
GolfScript - 45 38 36 characters
###Medium-force dirty implementation recurrence relation (38 36 characters):###
Medium-force dirty implementation recurrence relation (38 36 characters):
n%{~{.2$*{\(.2$f\2$(f+*}{=}if}:f~p}/
The recurrence relation I stole from Peter Taylors solution, it goes like this:
f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )
With special cases if either variable is 0.
My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.
###Light-force series solution (45 characters):###
Light-force series solution (45 characters):
n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/