OFFSET
0,4
LINKS
P. Haukkanen, J. K. Merikoski, Some formulas for numbers of line segments and lines in a rectangular grid, arXiv:1108.1041
MATHEMATICA
f[n_, k_] := Sum[x = kx/k; y = ky/k; If[IntegerQ[x] && IntegerQ[y] && CoprimeQ[x, y], (n - Abs[kx])(n - Abs[ky]), 0], {kx, -n + 1, n - 1}, {ky, -n + 1, n - 1}];
a[n_] := (f[n, 2] - f[n, 3])/2;
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, Aug 06 2013
STATUS
approved