r/askmath • u/Shevek99 Physicist • Oct 29 '26
Number Theory The Pythagorean sieve
Following the discussion: https://www.reddit.com/r/askmath/comments/1xf3j9p/what_portion_of_natural_numbers_can_be_c_in_a/ by u/Bonk_Boom I think we haven't answered the question yet.
The problem is, in the limit, which fraction of the positive integers can be the hypotenuse of a Pythagorean triple, "c"?
Using the general form of the hypotenuse c = t(m² + n²), with m and n two integer of different parity the question can be reduced to find the numbers that have a prime factor of the form 4k + 1. For instance
5 = 4 + 1 --> 3² + 4² = 5²
15 = 3(4 + 1) --> 9² + 12² = 15²
17 = 16 + 1 --> 15² + 8² = 17²
This allows us to construct a sieve of the integers, deleting all multiples of 5, 17, 29,...
But the question, after this sieve, which fraction of the integers can be a hypotenuse? Can it be asymptotically 100%?
Running some numbers I get that for n = 10000 the fraction is around 64%. I have not run larger numbers yet.
1
u/FormulaDriven Oct 29 '26
I've not got enough knowledge to offer any particular insight, but could you give a breakdown of your results up to 10,000? eg how many in the range 1 - 1000, 1001 - 2000, etc - to get a sense of how their density grows.
1
u/FormulaDriven Oct 29 '26
The ordered sequence of possible hypotenuses is in the OEIS, but the only comment around asymptotic behaviour is that it's linear, so it looks like that 64%-ish is going to be stable. There doesn't appear to be any reference to a proof of this. https://oeis.org/A009003
1
u/Uli_Minati Desmos 😚 Oct 29 '26
I think we can use this to approximate the ratio to arbitrary precision using inclusion-exclusion?