OFFSET
1,1
COMMENTS
In the form (u^2 - v^2, 2*u*v, u^2 + v^2), u^2 + v^2 is the hypotenuse, max(u^2 - v^2, 2*u*v) is the long leg and min(u^2 - v^2, 2*u*v) is the short leg.
A101930(n) gives the total number of Pythagorean triples <= 10^n.
number of terms <= h total number of
h in this sequence hypotenuses <= h percentage
10 1 2 50.0 %
100 15 52 28.8 %
1000 209 881 23.7 %
10000 2249 12471 18.0 %
100000 23086 161436 14.3 %
LINKS
Felix Huber, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Pythagorean Triple
FORMULA
EXAMPLE
The nonprimitive Pythagorean triple (6, 8, 10) is of the form (u^2 - v^2, 2*u*v, u^2 + v^2): From u = 3 and v = 1 follows u^2 - v^2 = 8 (long leg), 2*u*v = 6 (short leg), u^2 - v^2 = 10 (hypotenuse). Therefore, 10 is a term.
MAPLE
A386943:=proc(N) # To get all hypotenuses <= N
local i, l, u, v;
l:=[];
for u from 2 to floor(sqrt(N-1)) do
for v to min(u-1, floor(sqrt(N-u^2))) do
if gcd(u, v)>1 or is(u-v, even) then
l:=[op(l), [u^2+v^2, max(2*u*v, u^2-v^2), min(2*u*v, u^2-v^2)]]
fi
od
od;
l:=sort(l);
return seq(l[i, 1], i=1..nops(l));
end proc;
A386943(296);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Felix Huber, Aug 24 2025
STATUS
approved
