Commits

Shlomi Fish committed 53616a0

Add more.

  • Participants
  • Parent commits 14453ac

Comments (0)

Files changed (1)

project-euler/126/126-planning.txt

 (b[0]+b[0]+d*(n-1))*n)/2 = n*b[0] + d * n * (n-1) / 2
 
 Therefore: a[n] = a[0] + n*b[0] + d * n * (n-1) / 2
+
+In our case:
+
+a[0] = x*y+y*z+x*z
+b[0] = (x+y+z)*2;
+d = 4;
+
+Therefore:
+
+a[n] = x*y+y*z+x*z + n*(x+y+z)*2 + 4 * n * (n-1) /2 = 
+x*y+y*z+x*z + 2 * n * (x+y+z + n - 1)