Bell numbers: Difference between revisions

Content deleted Content added
Not a robot (talk | contribs)
Add ALGOL-M
Not a robot (talk | contribs)
Add APL
Line 98: Line 98:
4140.0 5017.0 6097.0 7432.0 9089.0 11155.0 13744.0 17007.0 21147.0
4140.0 5017.0 6097.0 7432.0 9089.0 11155.0 13744.0 17007.0 21147.0
21147.0 25287.0 30304.0 36401.0 43833.0 52922.0 64077.0 77821.0 94828.0 115975.0</pre>
21147.0 25287.0 30304.0 36401.0 43833.0 52922.0 64077.0 77821.0 94828.0 115975.0</pre>

=={{header|APL}}==
{{works with|Dyalog APL}}
<lang apl>bell←{
tr←↑(⊢,(⊂⊃∘⌽+0,+\)∘⊃∘⌽)⍣14⊢,⊂,1
⎕←'First 15 Bell numbers:'
⎕←tr[;1]
⎕←'First 10 rows of Bell''s triangle:'
⎕←tr[⍳10;⍳10]
}</lang>
{{out}}
<pre>First 15 Bell numbers:
1 1 2 5 15 52 203 877 4140 21147 115975 678570 4213597 27644437 190899322
First 10 rows of Bell's triangle:
1 0 0 0 0 0 0 0 0 0
1 2 0 0 0 0 0 0 0 0
2 3 5 0 0 0 0 0 0 0
5 7 10 15 0 0 0 0 0 0
15 20 27 37 52 0 0 0 0 0
52 67 87 114 151 203 0 0 0 0
203 255 322 409 523 674 877 0 0 0
877 1080 1335 1657 2066 2589 3263 4140 0 0
4140 5017 6097 7432 9089 11155 13744 17007 21147 0
21147 25287 30304 36401 43833 52922 64077 77821 94828 115975</pre>


=={{header|Arturo}}==
=={{header|Arturo}}==