17 lines
412 B
Text
17 lines
412 B
Text
\Bell numbers
|
|
code CrLf=9, IntOut=11, Text=12;
|
|
define MaxN = 14;
|
|
integer A(MaxN), I, J, N;
|
|
|
|
begin
|
|
for I:= 0 to MaxN - 1 do A(I):= 0;
|
|
N:= 0; A(0):= 1;
|
|
Text(0, "B("); IntOut(0, N); Text(0, ") = "); IntOut(0, A(0)); CrLf(0);
|
|
while N < MaxN do
|
|
begin
|
|
A(N):= A(0);
|
|
for J:= N downto 1 do A(J - 1):= A(J - 1) + A(J);
|
|
N:= N + 1;
|
|
Text(0, "B("); IntOut(0, N); Text(0, ") = "); IntOut(0, A(0)); CrLf(0)
|
|
end;
|
|
end
|