Jump to content

Catalan numbers/Pascal's triangle: Difference between revisions

Easylang
m (→‎{{header|Zig}}: Correct stdout. Add hyperlink to AKS primality task. Comment on comptime const pascal.)
(Easylang)
Line 543:
=={{header|Delphi}}==
See [https://rosettacode.org/wiki/Catalan_numbers/Pascal%27s_triangle#Pascal Pascal].
=={{header|EasyLang}}==
{{trans|AWK}}
<syntaxhighlight lang="easylang">
print 1
for n = 2 to 15
num = 1
den = 1
for k = 2 to n
num *= n + k
den *= k
cat = num / den
.
print cat
.
</syntaxhighlight>
 
 
=={{header|EchoLisp}}==
<syntaxhighlight lang="scheme">
Line 568 ⟶ 585:
→ 1 1 2 5 14 42 132 429 1430 4862 16796 58786 208012 742900 2674440 9694845
</syntaxhighlight>
 
=={{header|EDSAC order code}}==
Rather than store a triangular array, this solution stores the right-hand half of the current row and updates it in place. It uses the third method in the link, e.g. once we have the half row (70, 56, 28, 8, 1), the Catalan number 42 appears as 70 - 28.
2,063

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.