For 6 x 6
25 16 9 4 1 Squares in traditional orientation
16 4 Squares in the major/minor diagonal orientation
9 4 1 Squares in the other oblique orientations
9 4 1 Mirror of those directly above.
1
1
105
For 7 x 7
36 25 16 9 4 1 Squares in traditional orientation
25 9 1 Squares in the major/minor diagonal orientation
16 9 4 1 Squares in the other oblique orientations
16 9 4 1 Mirror of those directly above.
4 1
4 1
196
For n x n
Table for n x n dots:
n n-1 n-2 .............. 5 4 3 2 1
n (n-1)2 (n-2)2 .............. 16 9 4 1 0
(n-1)2 (n-2)2 .............. 16 9 4 1 0
(n-2)2 .............. 16 9 4 1 0
.............
.............
16 9 4 1 0
9 4 1 0
4 1 0
1 0
Sum of the sum of the above columns:
n2 + 2.(n-1)2 +3.(n-2)2 ............. (n-2).32 + (n-1).22 +n.12
Reverse
n.12 + (n-1).22 + (n-2).32 .............3.(n-2)2 + 2.(n-1)2 + n2
Add
(n2+n) + [22.(n-1)+2.(n-1)2] + [32.(n-2)+3.(n-2)2] + ...... ...... + [32.(n-2)+3.(n-2)2] + [22.(n-1)+2.(n-1)2] + (n2+n)
This is double what we want, so by division we have:
{(n2+n) + [22.(n-1)+2.(n-1)2] + [32.(n-2)+3.(n-2)2] + ...}/2
Simplify:
n(n+1) + 2(n-1)(2+n-1) + 3(n-2)(3+n-2) + ........ /2
=> n(n+1) + 2(n-1)(n+1) + 3(n-2)(n+1) + ...... /2
=> (n+1)[n + 2(n-1) + 3(n-2) + 4(n-3) + ......]/2
=> (n+1)[n + 2n - 2 + 3n -6 + 4n - 12 + ......]/2
As the length of the latter expression depends upon the value of n consider:
n= Expression
1 (n+1)( 1n - 0)/2
2 (n+1)( 3n - 2)/2
3 (n+1)( 6n - 8)/2
4 (n+1)(10n - 20)/2
. ........
. ........
Consider the second of the parentheses.
The coefficient of the variable is a triangular number while the constant is double the sum of triangular numbers. For any given "n", the coefficient is one term greater in the series than the constant. Thus the triangle value needs to be given by (n+1)(n+2)/2 rather than the usual n(n+1)/2.
The expression can now be written as:
[(n+1)/2].[n.(n+1).(n+2)/2 - n.(n+1).(n+2)/3]
=> [(n+1)/2].[n(n+1).(n+2).(1/2-1/3)]
=> n (n + 1)2 (n + 2)/12
By decrementing each multiple of the numerator by 1 we have:
(n - 1).(n)2.(n + 1)/12
=> n2 (n2 - 1)/12
Charlie notes this latter formula in his comments. The latter formula is specific to n x n dots whereas the formula which I have derived is more pertinent to n x n unit lengths (or cells). |