Motzkin numbers: Difference between revisions

m
Line 1,854:
≫ 'MOTZK' STO
|
'''MOTZK''' ''( n -- { M(0)..M(n) } )''
Loop from 2 to n
( M[i-1]*(2*i+1)
Line 1,883:
≫ 'MOTZK' STO
|
'''MOTZK''' ''( n -- { M(0)..M(n) } )''
Loop from 2 to n
get last 2 values of M(n) from the list
Line 1,891:
|}
Inputs and output are the same.
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">require "prime"
1,150

edits