Factorions: Difference between revisions

→‎{{header|Perl 6}}: Minor tweaks , better concurrency
m (→‎{{header|REXX}}: optimized the two inner DO loops.)
(→‎{{header|Perl 6}}: Minor tweaks , better concurrency)
Line 223:
say "\n\nFactorions in base $b:";
 
forprint ^"$b_ {" if $_ == @f[$_] {for print "^$_ " } }b;
 
hyper for (1 .. $limit div $b).hyper(:8degree).map: -> $i {
my $sum;
my $prod = $i * $b;
 
for $i.polymod($b xx *) {
$sum += @f[$_];
$sum = 0 and last if $sum > $prod
Line 236:
next if $sum == 0;
 
print "{$sumprod + @f[$_]} " and last if $sum + @f[$_] == $prod + $_ for ^$b;
}
}</lang>
10,333

edits