Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
import: parallel
|
||||
|
||||
: largeMinFactor dup mapParallel(#factors) zip maxFor(#[ second first ]) ;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import <Utilities/Conversion.sl>;
|
||||
import <Utilities/Math.sl>;
|
||||
import <Utilities/Sequence.sl>;
|
||||
|
||||
main(args(2)) :=
|
||||
let
|
||||
inputs := stringToInt(args);
|
||||
factored := primeFactorization(inputs);
|
||||
minFactors := vectorMin(factored);
|
||||
|
||||
indexOfMax := firstIndexOf(minFactors, vectorMax(minFactors));
|
||||
in
|
||||
"Number " ++ intToString(inputs[indexOfMax]) ++ " has largest minimal factor:\n" ++ delimit(intToString(factored[indexOfMax]), ' ');
|
||||
|
|
@ -0,0 +1 @@
|
|||
factored := primeFactorization(inputs);
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
var nums = [1275792312878611, 12345678915808973,
|
||||
1578070919762253, 14700694496703910,];
|
||||
|
||||
var factors = nums.map {|n| prime_factors.ffork(n) }.map { .wait }
|
||||
say ((nums ~Z factors)->max_by {|m| m[1][0] })
|
||||
Loading…
Add table
Add a link
Reference in a new issue