]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/project-euler/070/070.factor
Harmonize spelling
[factor.git] / extra / project-euler / 070 / 070.factor
index 499ce21c340a98eb82246dab18ee16a1598a192b..07e45fff3d50c69fb93e49af624bca19a6112801 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (c) 2010 Aaron Schaefer. All rights reserved.
 ! The contents of this file are licensed under the Simplified BSD License
 ! A copy of the license is available at http://factorcode.org/license.txt
-USING: arrays assocs combinators.short-circuit kernel math math.combinatorics
-    math.functions math.primes math.ranges project-euler.common sequences ;
+USING: arrays combinators.short-circuit kernel math math.combinatorics
+math.functions math.primes project-euler.common sequences
+sequences.extras ;
 FROM: project-euler.common => permutations? ;
 IN: project-euler.070
 
@@ -28,7 +29,7 @@ IN: project-euler.070
 ! --------
 
 ! For n/φ(n) to be minimised, φ(n) must be as close to n as possible; that is,
-! we want to maximise φ(n). The minimal solution for n/φ(n) would be if n was
+! we want to maximize φ(n). The minimal solution for n/φ(n) would be if n was
 ! prime giving n/(n-1) but since n-1 never is a permutation of n it cannot be
 ! prime.
 
@@ -54,7 +55,7 @@ IN: project-euler.070
     first2 { [ drop 7 10^ < ] [ permutations? ] } 2&& ;
 
 : minimum-ratio ( seq -- n )
-    [ [ first2 / ] map [ infimum ] keep index ] keep nth first ;
+    [ [ first2 / ] map arg-min ] keep nth first ;
 
 PRIVATE>