Partition function P: Difference between revisions
m
→{{header|Raku}}: minor style tweaks, remove some unnecessary reification
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: minor style tweaks, remove some unnecessary reification) |
||
Line 1,483:
Not the fastest, but it gets the job done.
<syntaxhighlight lang="raku" line>my @P = 1, { p(++$) } … *;
my @i = lazy [\+] flat 1, (
sub p ($n) { sum @P[$n X- @i
put @P[^26];
|