OFFSET
1,5
COMMENTS
Number of integer-sided obtuse or right (non-acute) triangles with largest side n. - Frank M Jackson, Dec 03 2014
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
a(5)=3 as there are 3 non-congruent integer triangles with base length 5 whose apex lies on or within the space bounded by the semicircle of diameter 5. The integer triples are (2,4,5), (3,3,5), (3,4,5).
MATHEMATICA
sumtriangles[c_] := (n=0; Do[If[a^2+b^2<=c^2, n++], {b, 1, c}, {a, c-b+1, b}]; n); Table[sumtriangles[m], {m, 1, 200}]
PROG
(PARI) a(n)=sum(a=2, n, sum(b=max(a, n+1-a), n, a^2+b^2<=n^2)) \\ Charles R Greathouse IV, Mar 26 2014
(PARI) a(n)=sum(a=2, n, max(min(sqrtint(n^2-a^2), n)-max(a, n+1-a)+1, 0)) \\ Charles R Greathouse IV, Mar 26 2014
(GeoGebra)
c = Slider(1, 20, 1);
L = Flatten(Sequence(Sequence(((a^2+c^2-(c-a+k)^2)/(2c), ((a+(c-a+k)+c)(a+(c-a+k)-c)(a-(c-a+k)+c)(-a+(c-a+k)+c))^(1/2)/(2c)), a, k, (c+k)/2), k, 1, c));
C = {Circle((c/2, 0), c/2)};
a_n = CountIf(IsInRegion((x(A), y(A)), Element(C, 1)), A, L);
# Frank M Jackson, Jan 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Jan 24 2014
STATUS
approved