Distribution of 0 digits in factorial series: Difference between revisions
Distribution of 0 digits in factorial series (view source)
Revision as of 16:25, 20 June 2021
, 2 years ago→{{header|Raku}}: fixed off-by-one sub-scripting
SqrtNegInf (talk | contribs) (Added Perl) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: fixed off-by-one sub-scripting) |
||
Line 660:
sink 10000!; # prime the iterator to allow multithreading
sub zs ($n) { ( constant zero-share = (^Inf).race(:32batch).map: { (.!.comb.Bag){'0'} / .!.chars } )[$n+1] }
.say for (
Line 668:
).map: -> \n { "{n}: {([+] (^n).map: *.&zs) / n}" }</lang>
{{out}}
<pre>100: 0.
1000: 0.
10000: 0.
</pre>
|