Open main menu
Home
Random
Log in
Settings
About ZCubes Wiki
Disclaimers
ZCubes Wiki
Search
Changes
← Older edit
Newer edit →
Manuals/calci/Pascal Triangle Fun
(view source)
Revision as of 16:05, 7 August 2020
195 bytes added
,
16:05, 7 August 2020
→Pretty Pascal Triangle
Line 44:
Line 44:
</pre>
</pre>
−
===Pretty Pascal Triangle===
−
<pre>
−
m=10;
−
pt=PASCALTRIANGLE(m)
−
pt
−
.map(
−
function (r,i)
−
{
−
var prefix= (REPEATCHAR(" ",(2*m-(2*i+1))/2).split(""));
−
return(
−
prefix
−
.concat(r.join(", ,").split(","))
−
.concat(prefix)
−
)
−
}
−
);
−
<pre>
+
==Pascal Triangle and Figurate Numbers==
+
+
PASCALTRIANGLE(20)
+
+
[https://en.wikipedia.org/wiki/Figurate_number]
−
Now we can use:
+
figuratenumbers=(n,r)=>(n+r-1)!C!r;
−
<pre>
+
a=[1..10,0..10]@figuratenumbers;
−
PASCALTRIANGLE
(10
,true
)
+
a.parts
(10)
−
<pre>
==Lucas, Fibonacci, Golden Ratio Relationship ==
==Lucas, Fibonacci, Golden Ratio Relationship ==
Line 93:
Line 80:
</pre>
</pre>
+
+
+
===Pretty Pascal Triangle===
+
<pre>
+
m=10;
+
pt=PASCALTRIANGLE(m)
+
pt
+
.map(
+
function (r,i)
+
{
+
var prefix= (REPEATCHAR(" ",(2*m-(2*i+1))/2).split(""));
+
return(
+
prefix
+
.concat(r.join(", ,").split(","))
+
.concat(prefix)
+
)
+
}
+
);
+
+
<pre>
+
+
Now we can use:
+
<pre>
+
PASCALTRIANGLE(10,true)
+
<pre>
Joseph
Administrators
, writer
2,824
edits