Created
January 27, 2020 16:19
-
-
Save dogbert17/9e039d6af26a09e144f144b4e0aba220 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my int $j = 2; | |
my int $cnt = 0; | |
my int $mult = 2; | |
CNT: | |
loop (;;) | |
{ | |
$mult +<= 1; | |
# my $x = Str($mult); | |
my $x = ~$mult; | |
if $x.chars() == 16 { | |
$mult div= 10; | |
} | |
if $x.starts-with("123") { | |
last CNT if ++$cnt >= 678910; | |
# say("Found $cnt => $j") if $cnt +& 1023 == 0; # this is slow | |
} | |
++$j; | |
} | |
say("Found $cnt => $j"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment