This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A189346 #21 May 28 2021 18:38:11 %S A189346 0,0,48,532,3088,11340,33824,83288,183344,364304,681872,1194100, %T A189346 1992976,3182332,4941360,7420640,10874720,15539952,21812720,30011924, %U A189346 40650368,54187196,71463440,92990296,119675712,152314920,192393872,240690060 %N A189346 Number of sets of four points on an n X n grid (or geoboard), exactly three of which are collinear. %C A189346 The four points build a triangle on an n X n grid, with one of them located on a side of the triangle. %C A189346 The number of sets of four points with the three collinear points in a horizontal or vertical line is 2*n^2*(n-1)*binomial(n,3) = 4*A090448(n). The number of sets of four points with the three collinear points in a diagonal line of slope 1 is 2*n*(n-1)*binomial(n,3) + 4*Sum_{k=3..n-1}(n^2-k)*binomial(k,3). The sum of these two values is a lower bound for this sequence. - _Nathaniel Johnston_, Apr 23 2011 %H A189346 Martin Renner, <a href="/A189346/b189346.txt">Table of n, a(n) for n = 1..76</a> %p A189346 A189346 := proc(n)local a,b,j,k,l,m,s,slopes,num,den,tot: tot := 0: slopes := {}: for b from 1 to ceil(n/2)-1 do for a from 0 to b do slopes := slopes union {a/b}: od: od: for s from 1 to nops(slopes) do num := numer(slopes[s]): den := denom(slopes[s]): if(num = 0)then tot := tot + 2*n^2*(n-1)*binomial(n,3): elif(num = den)then tot := tot + 2*(2*add(binomial(k,3)*(n^2-k), k=3..n) - binomial(n,3)*(n^2 - n)): else for j from 1 to n - 2*den do for k from 1 to n - 2*num do tot := tot + 4*(n^2 - 3): for l from 1 to n do for m from 1 to n do if((not l = j or not m = k) and (not l = j + den or not m = k + num) and (not l = j + 2*den or not m = k + 2*num) and (m - k)*den = num*(l - j))then tot := tot - 4: fi: od: od: od: od: fi: od: return tot: end: %p A189346 seq(A189346(n),n=1..15); # _Nathaniel Johnston_, Apr 23 2011 %Y A189346 Cf. A000938, A175383, A178256, A189345. %K A189346 nonn %O A189346 1,3 %A A189346 _Martin Renner_, Apr 20 2011 %E A189346 a(6)-a(28) from _Nathaniel Johnston_, Apr 23 2011