RosettaCodeData/Task/Left-factorials/Perl-6/left-factorials-1.pl6
2019-09-12 10:33:56 -07:00

6 lines
288 B
Raku

sub prefix:<!> ($k) { (constant l = 0, |[\+] 1, (|[\*] 1..*))[$k] }
$ = !10000; # Pre-initialize
.say for ( 0 10, 20 110 ).hyper(:4batch).map: { sprintf "!%d = %s", $_, !$_ };
.say for (1000, 2000 10000).hyper(:4batch).map: { sprintf "!%d has %d digits.", $_, chars !$_ };