Created
March 23, 2018 15:20
-
-
Save dogbert17/750ffbf9fe7022ef091e8172b70779d8 to your computer and use it in GitHub Desktop.
SEGV when profiling
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
# What 12-digit number do you form by concatenating the three terms in this sequence? | |
# real 0m1.648s | |
# user 0m1.576s | |
# sys 0m0.032s | |
# This is Rakudo version 2016.04-25-g1512da2 built on MoarVM version 2016.04 | |
use v6; | |
my @primes = (1001..(10_000 - 3330 * 2 - 1)).grep(-> $n { $n.is-prime && $n != 1487 && ($n + 3330).is-prime && ($n + 6660).is-prime }); | |
my $num = @primes.first(-> $n { ($n + 3330).comb ~~ any($n.comb.permutations) && ($n + 6660).comb ~~ any($n.comb.permutations)}); | |
say $num ~ ($num + 3330) ~ ($num + 6660); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment