aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2020-02-25 18:11:23 +0000
committerGitHub <noreply@github.com>2020-02-25 18:11:23 +0000
commit29183b30851f09a0975cd4898a9d3ebe503568ff (patch)
tree8b0eed32d91e0e11461652e60e172b55e8a76db2
parent0fd4beb471dcf6fa15360482a2d21c3209c2a456 (diff)
parentd28714c2d511fc9c218ac86fa1e7a8dd790f6a5a (diff)
downloadperlweeklychallenge-club-29183b30851f09a0975cd4898a9d3ebe503568ff.tar.gz
perlweeklychallenge-club-29183b30851f09a0975cd4898a9d3ebe503568ff.tar.bz2
perlweeklychallenge-club-29183b30851f09a0975cd4898a9d3ebe503568ff.zip
Merge pull request #1310 from holli-holzer/master
added impossibility check
-rw-r--r--challenge-049/markus-holzer/raku/ch-1.p66
1 files changed, 5 insertions, 1 deletions
diff --git a/challenge-049/markus-holzer/raku/ch-1.p6 b/challenge-049/markus-holzer/raku/ch-1.p6
index 5793330e98..44a9b0861b 100644
--- a/challenge-049/markus-holzer/raku/ch-1.p6
+++ b/challenge-049/markus-holzer/raku/ch-1.p6
@@ -1,4 +1,8 @@
sub MAIN( $n )
{
+ # I have no formal proof for this, but I have a strong hunch that it's true.
+ say "Impossible" and exit
+ if so ( 2, 4, 8 ... *² > $n ).first( $n %% * );
+
say (1, 10, { $_ %% 2 ?? $_ + 1 !! $_ * 10 } ... *).first( * %% $n );
-} \ No newline at end of file
+}