]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/project-euler/124/124.factor
project-euler: Rewrap, update links, add copyrights, tests
[factor.git] / extra / project-euler / 124 / 124.factor
index 9a504f1959fbe9dd8903fdd475cde1f997d365a6..5eb8f6f761423199589d1aacadf4bc13dd89766c 100644 (file)
@@ -1,19 +1,21 @@
 ! Copyright (c) 2009 Guillaume Nargeot.
 ! See https://factorcode.org/license.txt for BSD license.
-USING: arrays kernel math.primes.factors
-ranges project-euler.common sequences sorting ;
+USING: arrays kernel math.primes.factors ranges
+project-euler.common sequences sorting ;
 IN: project-euler.124
 
-! https://projecteuler.net/index.php?section=problems&id=124
+! https://projecteuler.net/problem=124
 
 ! DESCRIPTION
 ! -----------
 
-! The radical of n, rad(n), is the product of distinct prime factors of n.
-! For example, 504 = 2^3 × 3^2 × 7, so rad(504) = 2 × 3 × 7 = 42.
+! The radical of n, rad(n), is the product of distinct prime
+! factors of n. For example, 504 = 2^3 × 3^2 × 7, so rad(504) =
+! 2 × 3 × 7 = 42.
 
-! If we calculate rad(n) for 1 ≤ n ≤ 10, then sort them on rad(n),
-! and sorting on n if the radical values are equal, we get:
+! If we calculate rad(n) for 1 ≤ n ≤ 10, then sort them on
+! rad(n), and sorting on n if the radical values are equal, we
+! get:
 
 !   Unsorted          Sorted
 !   n  rad(n)       n  rad(n) k
@@ -28,8 +30,8 @@ IN: project-euler.124
 !   9    3          7    7    9
 !  10   10         10   10   10
 
-! Let E(k) be the kth element in the sorted n column; for example,
-! E(4) = 8 and E(6) = 9.
+! Let E(k) be the kth element in the sorted n column; for
+! example, E(4) = 8 and E(6) = 9.
 
 ! If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000).