RosettaCodeData/Task/Bell-numbers/Loglan82/bell-numbers.loglan82
2026-04-30 12:34:36 -04:00

28 lines
422 B
Text

(* Bell numbers *)
block
const
max_n = 13;
var
a: arrayof integer,
i, j, n: integer;
begin
array a dim (0 : max_n);
n := 0;
for i := 0 to max_n - 1
do
a(i) := 0
od;
a(0) := 1;
writeln("B(", n: 2, ") = ", a(0): 9);
while n < max_n
do
a(n) := a(0);
for j := n downto 1
do
a(j - 1) := a(j - 1) + a(j)
od;
n := n + 1;
writeln("B(", n: 2, ") = ", a(0): 9);
od;
end;