Clever :) It's basically the same idea except you left it in the recurrence relationship form, and I had removed the recurrence relationships. Both equally correct and quick to compute.
Type: Posts; User: helloworld922
Clever :) It's basically the same idea except you left it in the recurrence relationship form, and I had removed the recurrence relationships. Both equally correct and quick to compute.
Mathematical formulas for computing the value at each diagonal:
n^2-x*(n-1), where n is the width of the sub-spiral and x is which diagonal (0 is top-left, going counter-clock wise).
Simply sum...