Created
July 20, 2017 13:37
-
-
Save perlpilot/434bea65c71dff73f2991909e4bf6dc6 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
#!/bin/bash | |
perl6 -e 'for 2..2000000 { put $_*$_*$_+1; }' | factor | \ | |
perl6 -e ' | |
my $s = 1; | |
for lines().kv -> $i, $l { | |
my $ln = $i + 1; | |
$s += $l.words[*-1]-1; | |
say $ln, "\t", $s if $ln %% 1_000; | |
} | |
say $s;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment