aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-079/simon-proctor/raku/ch-1.raku10
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-079/simon-proctor/raku/ch-1.raku b/challenge-079/simon-proctor/raku/ch-1.raku
new file mode 100644
index 0000000000..4555876047
--- /dev/null
+++ b/challenge-079/simon-proctor/raku/ch-1.raku
@@ -0,0 +1,10 @@
+#!/usr/bin/env raku
+
+use v6;
+
+#| Count the total numbrer of set bits of the binary representations of all numbers from 1 to $N and return $total_count_set_bit % 1000000007
+sub MAIN (
+ UInt $N #= Max number to count up to
+) {
+ say ( [+] (1..$N).race.map( *.base(2).comb ).flat ) % 1000000007
+}