How many pythagorean triples are there where one side is given, and is $2^n$?

62 Views Asked by At

I have checked a table with all the Pythagorean triples (there are 127 of them) and I have counted them (there are 12), but how can I answer this question without counting them individually?

2

There are 2 best solutions below

0
On

There are infinite Pythagorean triples where $B=2^n$ as shown by a formula I developed $$A=(2n-1)^2+2(2n-1)k\qquad B=2(2n-1)k+2k^2\qquad C=(2n-1)^2+2(2n-1)k+2k^2$$ which makes this an easy problem. It generates the sets of triples shown in the sample below.

$$\begin{array}{c|c|c|c|c|c|c|} n & k=1 & k=2 & k=3 & k=4 & k=5 & k=6 \\ \hline Set_1 & 3,4,5 & 5,12,13& 7,24,25& 9,40,41& 11,60,61 & 13,84,85 \\ \hline Set_2 & 15,8,17 & 21,20,29 &27,36,45 &33,56,65 & 39,80,89 & 45,108,117 \\ \hline Set_3 & 35,12,37 & 45,28,53 &55,48,73 &65,72,97 & 75,100,125 & 85,132,157 \\ \hline Set_{4} &63,16,65 &77,36,85 &91,60,109 &105,88,137 &119,120,169 & 133,156,205 \\ \hline Set_{5} &99,20,101 &117,44,125 &135,72,153 &153,104,185 &171,140,221 & 189,180,261 \\ \hline Set_{6} &143,24,145 &165,52,173 &187,84,205 &209,120,241 &231,160,281 & 253,204,325 \\ \hline \end{array}$$

We can see $B$ is always a multiple of $4$ and for the first member of each set $B=4n$ where $n$ is the set number. I wrote a quick program to test $x$-number of sets to a depth-$x$ in each and it appears that powers of $2$ only appear in $primitives$ as the first member of each set. This means, if $k=1$, the formula reduces to $$A=4n^2-1\qquad B=4n\qquad C=4n^2+1$$ Here is the sample of the run showing $\qquad 2^x ==> f(n,k)=(A,B,C)$

$$ 2 ^ {2 } ==> f( 1 , 1 ) = (3 , 4 , 5 )\\ 2 ^ {3 } ==> f( 2 , 1 ) = (15 , 8 , 17 )\\ 2 ^ {4 } ==> f( 4 , 1 ) = (63 , 16 , 65 )\\ 2 ^ {5 } ==> f( 8 , 1 ) = (255 , 32 , 257 )\\ 2 ^ {6 } ==> f( 16 , 1 ) = (1023 , 64 , 1025 )\\ 2 ^ {7 } ==> f( 32 , 1 ) = (4095 , 128 , 4097 )\\ 2 ^ {8 } ==> f( 64 , 1 ) = (16383 , 256 , 16385 )\\ 2 ^ {9 } ==> f( 128 , 1 ) = (65535 , 512 , 65537 )\\ 2 ^ {10 } ==> f( 256 , 1 ) = (262143 , 1024 , 262145 )\\ 2 ^ {11 } ==> f( 512 , 1 ) = (1048575 , 2048 , 1048577 )\\ 2 ^ {12 } ==> f( 1024 , 1 ) = (4194303 , 4096 , 4194305 )\\ 2 ^ {13 } ==> f( 2048 , 1 ) = (16777215 , 8192 , 16777217 )\\ 2 ^ {14 } ==> f( 4096 , 1 ) = (67108863 , 16384 , 67108865 )\\ 2 ^ {15 } ==> f( 8192 , 1 ) = (268435455 , 32768 , 268435457 )\\ 2 ^ {16 } ==> f( 16384 , 1 ) = (1073741823 , 65536 , 1073741825 )\\ 2 ^ {17 } ==> f( 32768 , 1 ) = (4294967295 , 131072 , 4294967297 )\\ 2 ^ {18 } ==> f( 65536 , 1 ) = (17179869183 , 262144 , 17179869185 )\\ 2 ^ {19 } ==> f( 131072 , 1 ) = (68719476735 , 524288 , 68719476737 )\\ 2 ^ {20 } ==> f( 262144 , 1 ) = (274877906943 , 1048576 , 274877906945 )\\ $$ We can also see that, starting with $n=1$, the triple with the $next$ power of $2$ is obtained by doubling the value of $n$. There are an infinite number of these but this is as far as I could go without arbitrary precision. I hope it helps.

0
On

We have 2 cases:

The side is the hypothenuse

This means we have to solve the norm equation for $2^n$ in $\Bbb Z[i]$. As 2 factors as $2=(1+i)^2$ (up to units) it follows that for even exponents: $(2^n)^2=4^n=(1+i)^{4n}$ the right side is always real and therefore there are only degenerate solutions like $2^2=2^2+0^2$.

The side is a cathetus

This means we have to solve $$4^n=c^2-a^2=(c+a)(c-a)=:u\cdot v$$ and thus $c=(u+v)/2$ and $a=(u-v)/2$. As 2 is prime in $\Bbb Z$, $u$ and $v$ must be powers of 2: $u=2^{2n-k}$ and $v=2^k$ with the constraints $0<k<2n-k$ so that the solutions are: $$c,a=2^{k-1}(4^{n-k} \pm1) $$

For example, for $n=3$ we can have $k=1,2$ and consequently the two triples $(10,8,6)$ and $(17,8,15)$.

The constraint can be rewritten as $0<k<n$, hence we have exactly $n-1$ solutions for a given $n$ (up to order).

And for each $n>1$ there is exactly one primitive solution, namely the one with $k=1$:$$(4^{n-1}+1,2^n,4^{n-1}-1)$$ The other solutions are just multiples from smaller $n$'s.