login
a(n) is the number of distinct, non-similar acute triangles with integer sides and largest side <= n.
4

%I #23 Dec 28 2023 16:37:39

%S 1,2,4,7,12,16,26,34,46,56,76,90,116,135,161,187,229,257,308,344,394,

%T 439,511,558,636,698,779,849,959,1027,1152,1245,1362,1465,1603,1703,

%U 1874,2004,2164,2298,2507,2639,2867,3034,3235,3421,3690,3866,4147,4354

%N a(n) is the number of distinct, non-similar acute triangles with integer sides and largest side <= n.

%e For n=4, there are 9 acute triangles with integer sides and largest side <= 4. These have sides {a,b,c} = {1, 1, 1}, {1, 2, 2}, {1, 3, 3}, {1, 4, 4}, {2, 2, 2}, {2, 2, 4}, {2, 3, 3}, {3, 3, 4}, {3, 4, 4}. But {2, 2, 2} is similar to {1,1,1} and {2,2,4} is similar to {1,1,2}, so these two triangles are excluded from the list and therefore a(4)=7.

%p #nType=1 for acute triangles, nType=2 for obtuse triangles, nType=0 for both triangles

%p CountTriangles := proc (n, nType := 1)

%p local aa, oo, a, b, c, tt, lAcute;

%p aa := {}; oo := {};

%p for a from n by -1 to 1 do for b from a by -1 to 1 do for c from b by -1 to 1 do

%p if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c and gcd(a, gcd(b, c)) = 1 then

%p lAcute := evalb(0 < b^2+c^2-a^2);

%p tt := sort([a, b, c]);

%p if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if

%p end if

%p end do end do end do;

%p return sort(`if`(nType = 1, aa, `if`(nType=2,oo,`union`(aa,oo))))

%p end proc

%t Length@Select[DeleteDuplicates[Sort@# & /@ Tuples[Range@#, 3]], GCD @@ # == 1 && #[[1]] + #[[2]] > #[[3]] && #[[1]]^2 + #[[2]]^2 > #[[3]]^2 &] & /@ Range@50 (* _Hans Rudolf Widmer_, Dec 07 2023 *)

%Y Cf. A247588, A306674, A306676, A306677, A306678.

%K nonn

%O 1,2

%A _César Eliud Lozada_, Mar 04 2019