%I #9 Jun 08 2024 03:09:05
%S 0,0,2,4,9,10,25,22,38,49,56,56,111,71,119,141,153,126,249,166,244,
%T 299,279,244,463,288,361,489,517,373,677,436,626,719,620,665,1078,604,
%U 811,936,1000,749,1444,842,1221,1384,1173,1016,1871,1261,1393,1597,1566,1259
%N a(n) is the number of distinct triangles with area n whose vertices are points of an n X n grid.
%H Felix Huber, <a href="/A372915/b372915.txt">Table of n, a(n) for n=0..666</a>
%H Felix Huber, <a href="/A372915/a372915.pdf">Illustration of the term a(4) = 9</a>
%e See the linked illustration for the term a(4) = 9.
%p A372915:=proc(n)
%p local p,q,g,h,u,v,x,y,L,M;
%p L:=[];
%p for g from 2 to n do
%p h:=2*n/g;
%p if type(h,integer) then
%p for x to n do
%p M:=[g,sqrt(x^2+h^2),sqrt((g-x)^2+h^2)];
%p M:=sort(M);
%p if not member(M,L) then
%p L:=[op(L),M];
%p fi;
%p od;
%p fi;
%p od;
%p for p to n do
%p for q from 1 to p do
%p g:=sqrt(p^2+q^2);
%p h:=2*n/g;
%p u:=h/g*q;
%p v:=q+h/g*p;
%p for x from max(1,ceil(p/q*(v-n)+u)) to min(n,floor(p/q*v+u)) do
%p y:=q/p*(u-x)+v;
%p if type(y,integer) and x <> p and y <> q then
%p M:=[g,sqrt(x^2+(y-q)^2),sqrt((x-p)^2+y^2)];
%p M:=sort(M);
%p if not member(M,L) then
%p L:=[op(L),M];
%p fi;
%p fi;
%p od;
%p od;
%p od;
%p return numelems(L);
%p end proc;
%p seq(A372915(n),n=0..53);
%Y Cf. A045996, A088658, A303331, A320310, A320542, A320544, A334713, A372217, A372218.
%K nonn
%O 0,3
%A _Felix Huber_, Jun 02 2024