Bell numbers: Difference between revisions
Content added Content deleted
(Bell numbers in MSX Basic) |
(Replaced "shallowCopy" with "move".) |
||
Line 2,553: | Line 2,553: | ||
for i in 1..newRow.high: |
for i in 1..newRow.high: |
||
newRow[i] = newRow[i - 1] + row[i - 1] |
newRow[i] = newRow[i - 1] + row[i - 1] |
||
row |
row = move(newRow) |
||
yield row[^1] # The last value of the row is one step ahead of the first one. |
yield row[^1] # The last value of the row is one step ahead of the first one. |
||
Line 2,565: | Line 2,565: | ||
for i in 1..newRow.high: |
for i in 1..newRow.high: |
||
newRow[i] = newRow[i - 1] + row[i - 1] |
newRow[i] = newRow[i - 1] + row[i - 1] |
||
row |
row = move(newRow) |
||
yield row |
yield row |
||
Line 2,635: | Line 2,635: | ||
4140 5017 6097 7432 9089 11155 13744 17007 21147 |
4140 5017 6097 7432 9089 11155 13744 17007 21147 |
||
21147 25287 30304 36401 43833 52922 64077 77821 94828 115975</pre> |
21147 25287 30304 36401 43833 52922 64077 77821 94828 115975</pre> |
||
=={{header|PARIGP}}== |
=={{header|PARIGP}}== |
||
From the code at OEIS A000110, |
From the code at OEIS A000110, |