Bell numbers: Difference between revisions
m
→{{header|Delphi}}: MAX_N instead of confusing MAX_INDEX.
m (→{{header|XPL0}}: MaxN instead of confusing MaxIndex.) |
m (→{{header|Delphi}}: MAX_N instead of confusing MAX_INDEX.) |
||
Line 1,574:
const
var
n : integer; // index of Bell number
j : integer; // loop variable
a : array [0..
{ Subroutine to display that a[0] is the Bell number B_n }
Line 1,591:
a[0] := 1;
Display(); // some programmers would prefer Display;
while (n <
a[n] := a[0];
for j := n downto 1 do inc( a[j - 1], a[j]);
|