<div><div>I've got a question about a Leyland-numbers-listing Raku code which I saw at codegolf.stackexchange.com at https://codegolf.stackexchange.com/a/83013/98132</div><div> </div><div>I've slightly rearranged the code to make it print Leyland numbers up to 1 Billion:</div><div><strong>.say for grep {$_ < 1E11}, squish(sort [X[&({$^a**$^b+$b**$a})]] 2..32,2..32)</strong></div><div> </div><div>The question in short is:</div><div> </div><div>How does the cross reduce work there?</div><div> </div><div>Extra info:</div><div> </div><div>That cross reduce section surely does what this half-pseudo code tries to do:</div><div><strong>map { $^a ** $^b + $b ** $a }, 2..32,32...2</strong></div><div>The tricky part here is the use of reduce operators two times in a row, once before the cross operator, once before the & operator, which I guess donates a closure. How to interpret this usage of operators?</div><div> </div></div>Thread Next