Catalan numbers/Pascal's triangle: Difference between revisions

Content added Content deleted
m (Ran code through zig fmt.)
Line 2,220: Line 2,220:
var n: u32 = 1;
var n: u32 = 1;
while (n <= 15) : (n += 1) {
while (n <= 15) : (n += 1) {
const row = binomial(n*2).?;
const row = binomial(n * 2).?;
try stdout.print("{d:2} {d:8}\n", .{ n, row[n] - row[n+1] });
try stdout.print("{d:2} {d:8}\n", .{ n, row[n] - row[n + 1] });
}
}
}
}
Line 2,275: Line 2,275:
15 9694845
15 9694845
</pre>
</pre>

=={{header|zkl}}==
=={{header|zkl}}==
{{trans|PARI/GP}} using binomial coefficients.
{{trans|PARI/GP}} using binomial coefficients.