]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/project-euler/265/265.factor
project-euler: Rewrap, update links, add copyrights, tests
[factor.git] / extra / project-euler / 265 / 265.factor
index 2930a8586ea426b93bca0cb72d57e266c7a05045..1bda3e4e6bd36daefe6265d8bb155403213aad02 100644 (file)
@@ -4,24 +4,28 @@ USING: generalizations kernel math math.functions project-euler.common
 sequences sets ;
 IN: project-euler.265
 
-! https://projecteuler.net/index.php?section=problems&id=265
+! https://projecteuler.net/problem=265
 
-! 2^(N) binary digits can be placed in a circle so that all the N-digit
-! clockwise subsequences are distinct.
+! 2^(N) binary digits can be placed in a circle so that all the
+! N-digit clockwise subsequences are distinct.
 
-! For N=3, two such circular arrangements are possible, ignoring rotations.
+! For N=3, two such circular arrangements are possible, ignoring
+! rotations.
 
-! For the first arrangement, the 3-digit subsequences, in clockwise order, are:
-! 000, 001, 010, 101, 011, 111, 110 and 100.
+! For the first arrangement, the 3-digit subsequences, in
+! clockwise order, are: 000, 001, 010, 101, 011, 111, 110 and
+! 100.
 
-! Each circular arrangement can be encoded as a number by concatenating
-! the binary digits starting with the subsequence of all zeros as the most
-! significant bits and proceeding clockwise. The two arrangements for N=3 are
-! thus represented as 23 and 29:
+! Each circular arrangement can be encoded as a number by
+! concatenating the binary digits starting with the subsequence
+! of all zeros as the most significant bits and proceeding
+! clockwise. The two arrangements for N=3 are thus represented
+! as 23 and 29:
 ! 00010111 _(2) = 23
 ! 00011101 _(2) = 29
 
-! Calling S(N) the sum of the unique numeric representations, we can see that S(3) = 23 + 29 = 52.
+! Calling S(N) the sum of the unique numeric representations, we
+! can see that S(3) = 23 + 29 = 52.
 
 ! Find S(5).