login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A225606
Number of distinct lines passing through 3 or more points in an n X n grid.
4
0, 0, 0, 8, 14, 32, 58, 108, 174, 296, 406, 628, 898, 1216, 1582, 2188, 2754, 3528, 4398, 5524, 6778, 8336, 9778, 11812, 14038, 16456, 19066, 22540, 25954, 29968, 34270, 39116, 44282, 50312, 56026, 63196, 70798, 78984
OFFSET
0,4
FORMULA
a(n) = A018808(n) - A018809(n) = A018810(n) + A018811(n) + A018812(n) + A018813(n)+....
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;
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 30 2018, after Seppo Mustonen in A018808 *)
CROSSREFS
Sequence in context: A273843 A227867 A254034 * A117132 A064969 A236332
KEYWORD
nonn
AUTHOR
R. J. Mathar, Aug 06 2013
STATUS
approved