OFFSET
1,5
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) is 4 as the maximum side (other than the hypotenuse) a right triangle with integer sides and hypotenuse 5 can have.
MATHEMATICA
f[n_] := Block[{k = n - 1, m = Sqrt[n/2]}, While[k > m && !IntegerQ[Sqrt[n^2 - k^2]], k-- ]; If[k <= m, 0, k]]; Table[ f[n], {n, 90}] (* Robert G. Wilson v, Jun 21 2005 *)
PROG
(PARI) first(n) = {my(lh = List(), res = vector(n)); for(u = 2, sqrtint(n), for(v = 1, u, if (u^2+v^2 > n, break); if ((gcd(u, v) == 1) && (0 != (u-v)%2), for (i = 1, n, if (i*(u^2+v^2) > n, break); listput(lh, i*(u^2+v^2)); res[i*(u^2+v^2)] = max(res[i*(u^2+v^2)], max(i*(u^2 - v^2), i*2*u*v)); ); ); ); ); for(i = 1, n, if(res[i] == oo, res[i] = 0)); res } \\ David A. Corneth, Apr 10 2021, adapted from A009000
CROSSREFS
KEYWORD
nonn
AUTHOR
Sébastien Dumortier, Jun 20 2005
EXTENSIONS
More terms from Robert G. Wilson v, Jun 21 2005
STATUS
approved