Source

project-euler / project-euler / 147 / euler-147-analysis.txt

Diff from to

project-euler/147/euler-147-analysis.txt

 
 C(n,step) = n-1 * 2
 
+2* 2 diagonal rectangles:
+-------------------------
 
+C(1,1) = 0 ; C(2,1) = 0 ; C(2,2) = 1
+
+C(2,3) = C(2,2)+1 ; C(2,4) = C(2,3) + 1 ; C(2,step) = 1
+
+C(3,3) = C(2,3) + 3 ; C(3,4) = C(3,3) + 3 ; C(3,step) = 3
+
+C(4,4) = C(3,4) + 5 ; C(4,step) = 5
+
+C(5,step) = 7
+
+C(6,step) = 9
+
+C(n,step) = n*2-3;
+
+1*3 diagonal rectangles:
+------------------------
+
+C(1,1) = 0 ; C(2,1) = 0; C(2,2) = 0
+
+C(2,3) = 1 (in each direction - so 2 * 1 overall)
+
+C(2,4) = C(2,3) + 1 ; C(2,step) = 1
+
+C(3,3) = C(2,3) + 3 ; C(3,step)  = 3
+
+C(4,4) = C(3,4) + 5 ; C(4,step) = 5
+
+C(n,step) = n*2-3
+
+