Fibonacci n-step number sequences: Difference between revisions
Fibonacci n-step number sequences (view source)
Revision as of 13:29, 30 December 2021
, 2 years agoAdd APL
Not a robot (talk | contribs) (Add BQN) |
Not a robot (talk | contribs) (Add APL) |
||
Line 429:
lucus : 2 1 3 4 7 11 18 29 47 76
</pre>
=={{header|APL}}==
{{works with|Dyalog APL}}
<lang APL>nStep ← {⊃(1↓⊢,+/)⍣(⍺-1)⊢⍵}
nacci ← 2*0⌈¯2+⍳
↑((⍳10)nStep¨⊂)¨(nacci¨2 3 4),⊂2 1</lang>
{{out}}
<pre>1 1 2 3 5 8 13 21 34 55
1 1 2 4 7 13 24 44 81 149
1 1 2 4 8 15 29 56 108 208
2 1 3 4 7 11 18 29 47 76</pre>
=={{header|AppleScript}}==
|