Finding i - th Motzkin number .
while i <= n : NEW_LINE INDENT dp [ i ] = ( ( 2 * i + 1 ) * dp [ i - 1 ] + ( 3 * i - 3 ) * dp [ i - 2 ] ) / ( i + 2 ) ; NEW_LINE i = i + 1 NEW_LINE DEDENT return dp [ n ] ; NEW_LINE