A189346 Number of sets of four points on an n X n grid (or geoboard), exactly three of which are collinear.
0, 0, 48, 532, 3088, 11340, 33824, 83288, 183344, 364304, 681872, 1194100, 1992976, 3182332, 4941360, 7420640, 10874720, 15539952, 21812720, 30011924, 40650368, 54187196, 71463440, 92990296, 119675712, 152314920, 192393872, 240690060
Offset: 1
Keywords
Links
- Martin Renner, Table of n, a(n) for n = 1..76
Programs
-
Maple
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: seq(A189346(n),n=1..15); # Nathaniel Johnston, Apr 23 2011
Extensions
a(6)-a(28) from Nathaniel Johnston, Apr 23 2011
Comments