Motzkin numbers: Difference between revisions
→{{header|Ruby}}: Add the demo code...
(→{{header|Ruby}}: Add the demo code...) |
|||
Line 1,020:
y << m.last
end
end
motzkin.take(42).each_with_index do |m, i|
puts "#{'%2d' % i}: #{m}#{m.prime? ? ' prime' : ''}"
end
</lang>
|