Padovan n-step number sequences: Difference between revisions
m
→{{header|Ruby}}
(→{{header|Ruby}}: Add Ruby) |
|||
Line 1,497:
loop do
yield sum = ar[..-2].sum
ar.shift if ar.size >
ar << sum
end
Line 1,503:
t = 15
(2..8).each do
end
</syntaxhighlight>
Line 1,517:
N=8 : 2 3 5 8 13 21 34 54 87 140 225 362 582 936 1505
</pre>
=={{header|Rust}}==
<syntaxhighlight lang="rust">
|