From 035364d2ca9ca93bc276349c47fbd1fc4fb1e683 Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 21 Sep 2020 09:21:22 +0100 Subject: Challenge 1 --- challenge-079/simon-proctor/raku/ch-1.raku | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 challenge-079/simon-proctor/raku/ch-1.raku 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 +} -- cgit