OFFSET
1,8
COMMENTS
T(m,n) is the number of ways to choose four distinct points from an m X n rectangular grid that form a square aligned with the axes. See A271917 for the count of all subsquares.
EXAMPLE
The array begins:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
0, 2, 5, 8, 11, 14, 17, 20, 23, 26, ...
0, 3, 8, 14, 20, 26, 32, 38, 44, 50, ...
0, 4, 11, 20, 30, 40, 50, 60, 70, 80, ...
0, 5, 14, 26, 40, 55, 70, 85, 100, 115, ...
0, 6, 17, 32, 50, 70, 91, 112, 133, 154, ...
0, 7, 20, 38, 60, 85, 112, 140, 168, 196, ...
0, 8, 23, 44, 70, 100, 133, 168, 204, 240, ...
0, 9, 26, 50, 80, 115, 154, 196, 240, 285, ...
...
As a triangle:
0,
0, 0,
0, 1, 0,
0, 2, 2, 0,
0, 3, 5, 3, 0,
0, 4, 8, 8, 4, 0,
0, 5, 11, 14, 11, 5, 0,
0, 6, 14, 20, 20, 14, 6, 0,
0, 7, 17, 26, 30, 26, 17, 7, 0,
0, 8, 20, 32, 40, 40, 32, 20, 8, 0,
...
MAPLE
f1:=(m, n)->(1/6)*m*(m-1)*(3*n-m-1);
f2:=(m, n)->if n>=m then f1(m, n) else f1(n, m) fi;
for m from 1 to 10 do
lprint([seq(f2(m, n), n=1..10)]); od;
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Apr 26 2016
STATUS
approved