AKS test for primes: Difference between revisions
Content deleted Content added
→{{header|Perl 6}}: simplify |
→{{header|Perl 6}}: readability |
||
Line 373: | Line 373: | ||
say '-----------'; |
say '-----------'; |
||
sub super ($n) { |
|||
$n.trans: '0123456789' |
|||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
for ^13 -> $d { |
|||
⚫ | |||
say $d.fmt('%2i: '), ( |
|||
⚫ | |||
⚫ | |||
my $p = $d - $i; |
|||
join '', gather { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
take super $p - $i if $p > 1; |
|||
} |
|||
} |
} |
||
) |
|||
} |
} |
||