Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Smith-numbers/Perl/smith-numbers-1.pl
Normal file
7
Task/Smith-numbers/Perl/smith-numbers-1.pl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
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";
|
||||
4
Task/Smith-numbers/Perl/smith-numbers-2.pl
Normal file
4
Task/Smith-numbers/Perl/smith-numbers-2.pl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
use ntheory ":all";
|
||||
my $t=0;
|
||||
forfactored { $t++ if @_ > 1 && sumdigits($_) == sumdigits(join "",@_); } 10**8;
|
||||
say $t;
|
||||
Loading…
Add table
Add a link
Reference in a new issue