OFFSET
1,5
LINKS
Seiichi Manyama, Antidiagonals n = 1..140, flattened
Seppo Mustonen, On lines and their intersection points in a rectangular grid of points [Local copy]
FORMULA
A(n,k) = (1/2) * (f(n,k,1) - f(n,k,2)), where f(n,k,m) = Sum ((n-|m*x|)*(k-|m*y|)); -n < m*x < n, -k < m*y < k, (x,y)=1.
EXAMPLE
Square array begins:
0, 1, 1, 1, 1, ...
1, 6, 11, 18, 27, ...
1, 11, 20, 35, 52, ...
1, 18, 35, 62, 93, ...
1, 27, 52, 93, 140, ...
1, 38, 75, 136, 207, ...
MATHEMATICA
A[n_, k_] := (1/2)(f[n, k, 1] - f[n, k, 2]);
f[n_, k_, m_] := Sum[If[GCD[mx/m, my/m] == 1, (n - Abs[mx])(k - Abs[my]), 0], {mx, -n, n}, {my, -k, k}];
Table[A[n - k + 1, k], {n, 1, 11}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 04 2023 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Seiichi Manyama, Nov 26 2017
STATUS
approved