Motzkin numbers: Difference between revisions

Content added Content deleted
(Undo revision 343652 by Aamrun (talk))
(→‎{{header|Ruby}}: Add the demo code...)
Line 1,020: Line 1,020:
y << m.last
y << m.last
end
end
end

motzkin.take(42).each_with_index do |m, i|
puts "#{'%2d' % i}: #{m}#{m.prime? ? ' prime' : ''}"
end
end
</lang>
</lang>