aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark <53903062+andemark@users.noreply.github.com>2022-06-14 19:51:29 +0000
committerMark <53903062+andemark@users.noreply.github.com>2022-06-14 19:51:29 +0000
commitb9da285d4b707d619707f5f318f56e95fc982333 (patch)
tree88bcc578994bf9bf814152f5ebe389b929649dab
parent6777d3cc7c54b17b08ddcecdad668fd96355c621 (diff)
downloadperlweeklychallenge-club-b9da285d4b707d619707f5f318f56e95fc982333.tar.gz
perlweeklychallenge-club-b9da285d4b707d619707f5f318f56e95fc982333.tar.bz2
perlweeklychallenge-club-b9da285d4b707d619707f5f318f56e95fc982333.zip
ch-2.raku do-over
-rw-r--r--challenge-169/mark-anderson/raku/ch-2.raku10
1 files changed, 7 insertions, 3 deletions
diff --git a/challenge-169/mark-anderson/raku/ch-2.raku b/challenge-169/mark-anderson/raku/ch-2.raku
index ad23340ad3..8c94a93080 100644
--- a/challenge-169/mark-anderson/raku/ch-2.raku
+++ b/challenge-169/mark-anderson/raku/ch-2.raku
@@ -1,6 +1,6 @@
#!/usr/bin/env raku
-my $n = 1000000;
+my $n = 100_000_000;
my $powerful = set gather
for 2..sqrt($n) -> $a
@@ -27,5 +27,9 @@ for 2..sqrt($n) -> $a
my $achilles = $powerful (-) $perfect;
my @achilles = $achilles.keys.sort;
-say @achilles.head(20); # (72 108 200 288 392 432 500 648 675 800 864 968 972 1125 1152 1323 1352 1372 1568 1800)
-say @achilles[900]; # 972000
+say @achilles[^20] ; # (72 108 200 288 392 432 500 648 675 800 864 968 972 1125 1152 1323 1352 1372 1568 1800)
+say @achilles[9990..9999]; # (90025452 90048200 90100125 90101888 90117775 90124083 90124672 90140256 90155592 90209312)
+
+# real 1.45
+# user 1.69
+# sys 0.10