RosettaCodeData/Task/Smith-numbers/Perl/smith-numbers-1.pl
2023-07-01 13:44:08 -04:00

7 lines
196 B
Raku

use ntheory qw/:all/;
my @smith;
forcomposites {
push @smith, $_ if sumdigits($_) == sumdigits(join("",factor($_)));
} 10000-1;
say scalar(@smith), " Smith numbers below 10000.";
say "@smith";