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”).

A045996
Number of triangles in an n X n grid (or geoplane).
22
0, 4, 76, 516, 2148, 6768, 17600, 40120, 82608, 157252, 280988, 477012, 775172, 1214768, 1844512, 2725000, 3930384, 5550844, 7692300, 10482124, 14066996, 18619128, 24337056, 31449200, 40212160, 50921316, 63907468, 79542108
OFFSET
1,2
COMMENTS
The triangles must have nonzero area -- their vertices must not be collinear.
The degenerate (i.e., collinear) triangles are counted in A000938. The 1000-term b-file there could be used to produce a 1000-term b-file for the present sequence. - N. J. A. Sloane, Jun 19 2020
LINKS
I. L. Canestro, Checkerboard, sci.math 22 Oct 2000 [broken link]
I. L. Canestro, Checkerboard, sci.math 22 Oct 2000 [Cached copy]
FORMULA
a(n) = ((n-1)^2*n^2*(n+1)^2)/6 - 2*Sum_{m=2..n} Sum_{k=2..n} (n-k+1)*(n-m+1)*gcd(k-1, m-1).
a(n) = binomial(n^2,3) - A000938(n). - R. J. Mathar, May 21 2010
EXAMPLE
a(2)=4 because 4 isosceles right triangles can be placed on a 2 X 2 grid.
MATHEMATICA
a[n_] := ((n - 1)^2*n^2*(n + 1)^2)/6 - 2*Sum[(n - k + 1)*(n - l + 1)*GCD[k - 1, l - 1], {k, 2, n}, {l, 2, n}]; Array[a, 28] (* Robert G. Wilson v, May 23 2010 *)
CROSSREFS
Cf. A000938.
Sequence in context: A317903 A101718 A094160 * A190395 A240281 A114453
KEYWORD
nice,nonn,easy
STATUS
approved