REDUCE

7.5 Motzkin numbers

A Motzkin number Mn (named after Theodore Motzkin) is the number of different ways of drawing non-intersecting chords on a circle between n points. For a non-negative integer n, the operator Motzkin(n) returns the nth Motzkin number, according to the recursion formula

M  =  1;  M  = 1;  M     =  2n+-3-M  + --3n- M    .
  0         1        n+1    n + 3   n  n + 3   n−1