%I #59 Feb 20 2017 12:11:27
%S 0,4,36,148,444,1064,2200,4024,6976,11284,17396,25620,36812,51216,
%T 69672,92656,121392,156092,198364,248292,307988,377816,459072,552216,
%U 660704,784076,924340,1082228,1261132,1460408,1684464,1931800,2208368
%N Number of isosceles triangles that can be formed from the n^2 points of n X n grid of points (or geoboard).
%C This counts triples of distinct points A,B,C such that A,B,C are the vertices of an isosceles triangle with nonzero area. It would be nice to have a formula. - _N. J. A. Sloane_, Apr 22 2016
%C Place all bounding boxes of A279413 that will fit into the n X n grid in all possible positions, and the proper rectangles in two orientations: a(n) = sum(i=1..n, sum(j=1..i, k * (n-i+1) * (n-j+1) * A279413(i,j) where k=1 when i=j and k=2 otherwise. _Lars Blomberg_, Feb 20 2017
%H Lars Blomberg, <a href="/A186434/b186434.txt">Table of n, a(n) for n = 1..10000</a> (the first 67 terms from Nathaniel Johnston)
%H Barile, Margherita: <a href="http://mathworld.wolfram.com/Geoboard.html">MathWorld -- Geoboard.</a>
%H Nathaniel Johnston, <a href="/A186434/a186434.c.txt">C program for computing terms</a>
%p with(linalg):
%p IsTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if evalf(norm(a,2)+norm(b,2))>evalf(norm(c,2)) and evalf(norm(a,2)+norm(c,2))>evalf(norm(b,2)) and evalf(norm(b,2)+norm(c,2))>evalf(norm(a,2)) then true: else false: fi: end:
%p IsIsoscelesTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if IsTriangle(points) then if norm(a,2)=norm(b,2) or norm(a,2)=norm(c,2) or norm(b,2)=norm(c,2) then true: else false: fi: else false: fi; end:
%p a:=proc(n) local P,TriangleSet,i,j,a,b,c; P:=[]: for i from 0 to n do for j from 0 to n do P:=[op(P),[i,j]]: od; od; TriangleSet:={}: for a from 1 to nops(P) do for b from a+1 to nops(P) do for c from b+1 to nops(P) do if IsIsoscelesTriangle([P[a],P[b],P[c]]) then TriangleSet:={op(TriangleSet),[P[a],P[b],P[c]]}; fi; od; od; od; return(nops(TriangleSet)): end:
%Y Cf. A045996, A077435, A187452, A189416, A271910-A271913, A271915, A279413, A279414.
%Y Dividing by 4 gives A271908.
%K nonn
%O 1,2
%A _Martin Renner_, Apr 10 2011, Apr 13 2011
%E a(10) - a(33) from _Nathaniel Johnston_, Apr 25 2011