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

A306673
a(n) is the number of distinct, non-similar acute triangles with integer sides and largest side <= n.
4
1, 2, 4, 7, 12, 16, 26, 34, 46, 56, 76, 90, 116, 135, 161, 187, 229, 257, 308, 344, 394, 439, 511, 558, 636, 698, 779, 849, 959, 1027, 1152, 1245, 1362, 1465, 1603, 1703, 1874, 2004, 2164, 2298, 2507, 2639, 2867, 3034, 3235, 3421, 3690, 3866, 4147, 4354
OFFSET
1,2
EXAMPLE
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.
MAPLE
#nType=1 for acute triangles, nType=2 for obtuse triangles, nType=0 for both triangles
CountTriangles := proc (n, nType := 1)
local aa, oo, a, b, c, tt, lAcute;
aa := {}; oo := {};
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
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
lAcute := evalb(0 < b^2+c^2-a^2);
tt := sort([a, b, c]);
if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
end if
end do end do end do;
return sort(`if`(nType = 1, aa, `if`(nType=2, oo, `union`(aa, oo))))
end proc
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
César Eliud Lozada, Mar 04 2019
STATUS
approved