Lah numbers: Difference between revisions

Content added Content deleted
Line 388: Line 388:
<lang zkl>var [const] BI=Import("zklBigNum"); // libGMP
<lang zkl>var [const] BI=Import("zklBigNum"); // libGMP
N=100;
N=100;
L100:=[1..N].apply(lah.fpM("101",BI(N),fcn(n){ BI(n).factorial() }))
println("Maximum value from the L(%d, *) row:".fmt(N));
[1..N].apply(lah.fpM("101",BI(N),fcn(n){ BI(n).factorial() }))
.reduce(fcn(m,n){ m.max(n) });
println("Maximum value from the L(%d, *) row (%d digits):".fmt(N,L100.numDigits));
.reduce(fcn(m,n){ m.max(n) }).println();</lang>
println(L100);</lang>
{{out}}
{{out}}
<pre style="font-size:83%">
<pre style="font-size:83%">
Maximum value from the L(100, *) row:
Maximum value from the L(100, *) row (164 digits):
44519005448993144810881324947684737529186447692709328597242209638906324913313742508392928375354932241404408343800007105650554669129521241784320000000000000000000000
44519005448993144810881324947684737529186447692709328597242209638906324913313742508392928375354932241404408343800007105650554669129521241784320000000000000000000000
</pre>
</pre>