Catalan numbers/Pascal's triangle: Difference between revisions
Content added Content deleted
PatGarrett (talk | contribs) (Move above) |
PatGarrett (talk | contribs) (Add Scilab section) |
||
Line 566: | Line 566: | ||
Wscript.echo t(i+1)-t(i) |
Wscript.echo t(i+1)-t(i) |
||
next 'i</lang> |
next 'i</lang> |
||
=={{header|Scilab}}== |
|||
<lang> |
|||
n=15 |
|||
t=zeros(1,n+2) |
|||
t(1)=1 |
|||
for i=1:n |
|||
for j=i+1:-1:2 |
|||
t(j)=t(j)+t(j-1) |
|||
end |
|||
t(i+1)=t(i) |
|||
for j=i+2:-1:2 |
|||
t(j)=t(j)+t(j-1) |
|||
end |
|||
disp(t(i+1)-t(i)) |
|||
end |
|||
</lang> |
|||
{{out}} |
|||
<pre style="height:20ex"> |
|||
1. |
|||
2. |
|||
5. |
|||
14. |
|||
42. |
|||
132. |
|||
429. |
|||
1430. |
|||
4862. |
|||
16796. |
|||
58786. |
|||
208012. |
|||
742900. |
|||
2674440. |
|||
9694845. |
|||
</pre> |
|||
=={{header|Seed7}}== |
=={{header|Seed7}}== |