aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-141/feng-chang/raku/ch-1.raku5
-rwxr-xr-xchallenge-141/feng-chang/raku/ch-2.raku5
2 files changed, 10 insertions, 0 deletions
diff --git a/challenge-141/feng-chang/raku/ch-1.raku b/challenge-141/feng-chang/raku/ch-1.raku
new file mode 100755
index 0000000000..ba42e19fb3
--- /dev/null
+++ b/challenge-141/feng-chang/raku/ch-1.raku
@@ -0,0 +1,5 @@
+#!/bin/env raku
+
+my method divisors(UInt:D $n : --> Seq:D) { (1..$n).grep($n %% *) }
+
+put (1..∞).grep(*.&divisors == 8)[^10];
diff --git a/challenge-141/feng-chang/raku/ch-2.raku b/challenge-141/feng-chang/raku/ch-2.raku
new file mode 100755
index 0000000000..4f47828458
--- /dev/null
+++ b/challenge-141/feng-chang/raku/ch-2.raku
@@ -0,0 +1,5 @@
+#!/bin/env raku
+
+sub MAIN(UInt:D \m, UInt:D \n) {
+ put m.comb.combinations(1 .. m.comb.elems-1)».join.grep(* %% n).elems;
+}