diff options
| author | kevincolyer <kevin@thecolyers.net> | 2020-03-06 10:54:42 +0000 |
|---|---|---|
| committer | kevincolyer <kevin@thecolyers.net> | 2020-03-06 10:54:42 +0000 |
| commit | 414e83f973d4b3aa62a6d3be2de576fd88b658aa (patch) | |
| tree | e0375283f440149ee260b42aa11c72c6d94326ee | |
| parent | caaa74bd4be2b87d769f3b484a06b82610703b81 (diff) | |
| download | perlweeklychallenge-club-414e83f973d4b3aa62a6d3be2de576fd88b658aa.tar.gz perlweeklychallenge-club-414e83f973d4b3aa62a6d3be2de576fd88b658aa.tar.bz2 perlweeklychallenge-club-414e83f973d4b3aa62a6d3be2de576fd88b658aa.zip | |
minor changes
| -rw-r--r-- | challenge-049/kevin-colyer/raku/ch-1.p6 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-049/kevin-colyer/raku/ch-1.p6 b/challenge-049/kevin-colyer/raku/ch-1.p6 index 8acb119abb..2f8c7b2822 100644 --- a/challenge-049/kevin-colyer/raku/ch-1.p6 +++ b/challenge-049/kevin-colyer/raku/ch-1.p6 @@ -8,11 +8,11 @@ # For given number 55, the smallest multiple is 110 consisting of # digits 0 and 1. - +my Int $z10; sub MAIN(Int $number where * > 1) { - for 1..Inf -> $zero-ones { + for 1..Inf -> Int $zero-ones { # calculate all numbers with 0 or 1's in them (i.e. binary!) - my $z10=$zero-ones.base(2); + $z10=+$zero-ones.base(2); # use the binary string as a decimal value in trial division if $z10 %% $number { say "Smallest multiple of $number that consists of 0's and 1's is {$z10 / $number} gives {$z10} (found in $zero-ones iterations)"; |
