Abstract

The well‐known matrix‐generated tree structure for Pythagorean triplets is extended to the primitive solutions of the Diophantine equation where is a positive square‐free integer. The proof is based on a parametrization of these solutions as well as on a dual version of the Fermat’s method of descent.

1. Introduction

Let be a positive square‐free integer. In this paper, the structure of the solutions to the Diophantine equationis determined (Cf. [19]). Since (1) is homogeneous, we may assume that is primitive, i.e., It is well‐known ([1014]) that in the classical case , all such Pythagorean triplets (or nodes) form an infinite tree that is generated by the action of three explicit matrices at each node beginning with the root . All nodes descend to (3, 4, 5), and each node appears exactly once.

For each fixed , we construct finite sets of matrices and finite sets of roots that generate all solutions to (1). Given a primitive solution of equation (1), an algorithm describes a path (or descent) to some element in the finite set of roots. The main differences in the classical case are that the descent path may not be unique and that the action of the matrices may result in a nonprimitive solution. These anomalies may, respectively, be remedied by removing improper branches and by dividing nodes by their gcds. Moreover, if is 2, 6, or any odd square‐free integer, the only root is . In addition, for any other square‐free , nodes may descend to other roots defined as follows in terms of generating sets.

The essential idea of a generating set for solutions of (1) is a variation of Fermat’s method of descent that requires the following to be true for special related sets of nonsingular matrices:

Definition 1. Let be a positive square‐free integer and let be a set of nonsingular matrices. A primitive solution of (1) satisfies the Fermat’s method of descent with respect to , if there exists an element of with inverse such that the inner product is a positive integer multiple of a primitive solution where one of the following holds:(a)(b) and (c) is even and is a binary root, i.e., and , and in this case, is called the copartner of .By Lemma 13, it will follow that for any positive square‐free integer , there exists a set of nonsingular matrices such that every primitive solution of (1) satisfies the Fermat’s method with respect to . Given a primitive solution of (1), we generate the sequence of descents as follows: , and for and subsequently show that after a finite number of steps, the result is a positive integer times either or a primitive binary root. Moreover, we characterize all binary roots and their copartners in Theorem 12 and prove that in the sequence of descents, intertwines indefinitely as follows: , etc.

Definition 2. A finite set of matrices with integer entries is said to be a generating set for solutions to (1) whenever the following conditions hold:(a)if is in and is an integer solution to (1), then also satisfies (1);(b)if is a primitive solution to (1), then there exists a positive integer and a primitive root that is either binary or such that )..The origin of the generating sets is Shaw’s observation which shows that if satisfies (7), then so does where is not a solution to (1) andor equivalently, satisfies (1) where andThe sets result from judicious choices of the triplets as follows:

Definition 3. Let be a square‐free positive integer and let denote 1 if is even and 2 otherwise. The seminal matrix is defined bywhere . Moreover, let and satisfy and .
For all and is an integer matrix such that if is a primitive solution to (1), then . is an integer solution to (1).
Multiplication by the matrices , where is the identity matrix, is with the ‐entry replaced by , and is with both (1, 1) and (2, 2) entries replaced by , will be used to ensure that the components of solutions are nonnegative. In particular, paths from to a root will be in terms of products of descent matrices ., whereas paths back to will be with products of ascent matrices . .
Our main result is

Theorem 4. For any positive square‐free integer , the setgenerates all primitive solutions to (1).
Minimal generating subsets of are and defined as follows: if , then
If or 5, thenFinally, for (a)If , then is a generating set for all primitive solutions.(b)On the other hand, if , thenis a generating set.

Remark 5. Since , we have the following useful bounds:

Example 1. , root , and generating setwe haveso the first level consists of the proper nodes (2, 1, 3) and (19, 4, 21). Continuing as above,Dropping the irrelevant outputs and , the first two levels of the tree of all primitive solutions by the proof of Theorem 4 are given in Figure 1.

2. Parametric Representation

Our descent method depends on the following generalization of the classical representation theorem ([1517]) for primitive Pythagorean triplets.

Proposition 6. Let be an even square‐free positive integer. The primitive solutions of (1) are exactly of the formfor positive integers and such that and ()

On the other hand, if is an odd square‐free positive integer, then the primitive solutions of (1) are given exactly by the following: When is even, as defined above where, in addition, a and are of opposite parity; and when is odd, where a and are odd.

Proof. Suppose that is a primitive solution of (1) so that the following holds:
If is even, then .
Otherwise,Assume first that is even. Then, by (1), and have the same parities, where zx and are even, and since is square‐free, and are even. It follows that and are odd since is primitive. By (14), each prime factor (including 2) of divides either or , i.e., there exist integers and such that and . Moreover, any prime divisor of and must be 1 since it also divides and (i.e., and z). Consequently, and for positive integers and by the prime factorization theorem (See [4]).
Solving for , we have where . Furthermore, (, a) iff iff iff . Let be a prime divisor of and . Then, divides by (14) where may be at most one factor of It follows that divides (and y) so that since is primitive.
Conversely, suppose that . Then, , and , and are positive. Finally, as above, (, a m); and is primitive since any prime divisor is a divisor of and
Similar arguments may be made when is odd and is either even or odd.

Remark 7. For a fixed factorization of square‐free and primitive solution of (1), we have the following simple criteria for types:(a) if and only if is a square integer.(b) if and only if is a square integer.These ensue directly from Proposition 6: For (a) so we show that the condition is a square integer holds only in this case. The other possibilities are(i) where . But in this case, square integer, since .(ii) where is not a square integer.(iii) where . Again, in this case, square integer, since .(b)is similar.

Remark 8. The proof of Proposition 6 shows the following concerning the parametric representations of primitive solutions of (1) for square‐free :
If is even, then where is the product of the common factors of and ; and
Furthermore, and . In this case, if is odd, then a and are of opposite parity.
On the other hand, if is odd, then is odd and where is the product of the common factors of and ; In this case, a and are odd such that and

Remark 9. Since , expressions involving . may be simplified accordingly: , then . Otherwise, .
The next result will be useful in expressing primitive solutions in terms of a generating set according to Definition 2.

Lemma 10. The descent and ascent matrices are related by inverse formulas for all j, and : , then Inv .
Otherwise, and .

Proof. Suppose that is a solution to (1) and . By the definitions of and given in Section 1,is a solution to (1) such thatwhere . Consequently, andfor every solution to (1). In particular, by Proposition 6, this identity holds for . Since the determinant of the matrix with these solutions as rows is , we have that the solutions are linearly independent and, therefore, is the identity matrix. Lemma 10 is now immediate since the vectors in the definitions of the seminal matrices satisfy

3. Theorem 4 When Is Even

We now show that the only possibility of binary roots defined by Definition 1 is when square‐free is even and where . In this case, the identityreduces to “” binary roots of the form . Moreover, the copartner of satisfieswhere . Note that the multiples and will usually be ignored in the descent process.

The next result is unexpected in view of the definitions of and It will play a key role in determining the constant

Lemma 11. Let be a square‐free even integer The following are equivalent:(a)(b)(c) is even.Similarly, the following are equivalent:(d)(e)(f) is odd

Proof. Let be even and square‐free.. If , then so is even since and are odd.. It is similar to .. Assume that . Then, by the definitions of and Since and are even integers, we have that Moreover, as in Remark 8,so and (a) follows.. Assume that p. Then, in this case,Since and are even, Similarly, by the assumption,Since and are even, and follows. It remains to show . Assume that . Then, either or p. However, if , then by , which is false in this case, so .. We only need to show which is similar to .. It remains to show . Assume is even. Either or . By the equivalences and , either or . But if , then so must be odd (a contradiction) since is odd and is even. It follows that and (a) results.. It is similar to .By Lemma 11, we have the resulting characterizations of binary roots and their copartners:

Theorem 12. Let the square‐free integer be even. There are exactly standard binary roots as follows: Let for some integer in . Then, and we have the following cycle:It follows that is a binary root with copartner ( ) by Definition 1.
Moreover, if , thenwhere ( , , 1) is primitive and similarly,where 2, ) is primitive.

Proof. Let d ≥ 10 be even and square‐free. Then, q ≥ 3 and r ≥ 0.
Let us suppose first that r is even and where 0 ≤ i ≤ r/2. By Lemma 11, and . By Remark 9, since ,Moreover, ( )
By expanding and comparing each component, we have the proposed equation.
By Proposition 6, is a solution to (1) since is even and is even, so by the definition of and part (b) of Lemma 11, . Furthermore, ( ) is also a solution since is even and by the first case.
By the proof of Proposition 6, is primitive if and only if (or equivalently: , since is square‐free).
The proof of the equation when is odd is the same as in except for different values of the variables.
Moreover, is a solution to (1) since is even and : by the definitions of and , we have . Additionally, ( ) is also a solution by the first case as in part (a).
For the corresponding relations, we simply replace by in the algebraic part of the previous proof.
Finally, by the proof of Proposition 6, ( ) is primitive if and only ifFactoring out of and ( ) are straightforward computations. The first result is primitive since is square‐free and . The second is similar since is also
For example, if , then and . Let us suppose that . Then,By (18) and (31), Theorem 12 holds for the more general forms and of binary roots and their copartners whenever is even.
In this case, they are primitive if and only if and if and only if is odd and .

4. A General Interval Decomposition

Let us consider the following sets of inverses for the set from Definition 1:

By Lemma 10, these sets contain noninteger matrices, but in some sense and from Theorem 4 will, respectively, be their generator completions.

Let be a primitive solution of (1). By Proposition 6, there is a unique factorization such that is either or for certain positive integers a and with and (, a ) . The interval (a ) will now be expressed as a union of subintervals with the property that if is in the kth subinterval, then there is an element of or such that is a positive integer multiple of a primitive solution as in Definition 1. The following elementary result plays an essential role in identifying the “generator” It is expressed in an equivalent form without the parameters , a and , and consequently, may be used to determine and when dealing with large values of that not feasible to factoring.

By Proposition 6, for primitive solution of (1), , and by the proof, (, a) is equivalent to . (Actually, follows directly from being a primitive solution of (1)).

Lemma 13. Let be a primitive solution of (l) for some positive square‐free integer Suppose that integer satisfies so that

Then, and when is in any of the intervals in except for a specified case of :(a)For and , Moreover, if , then (b)For and , either(i)( where and where whenever .or(ii)() where However, if is even and in (), then is a binary root. This is the only possibility for part (c) of Definition 1.(c)For , either(i) where and or(ii), where andIn this case, faster convergence may be obtained with the largest possible Moreover, if then Note that the case is a consequence of parts (e), (f), and (g).On the other hand, let and . Then, satisfies Definition 1 if(d)In this case, and (e) In this case, and Moreover, if , then (f)In this case, and (g) 

In this case, and

Proof. Let so that (31) is straightforward. Remark 9 may be helpful with the following computations since:(a)Let , and for : Similarly,Moreover, is a quadratic equation in with discriminant ‐. Evaluating at , we find that , so is always positive.It follows that the components are all positive if and only ifNext,and if and only if 2 .Note that it is straightforward to show By hypothesis, assume that where By the previous part, the components of are positive and z‐x Since , it follows by Remark 5 thatTherefore, by the second equivalence given above, we have thatNote that since , it follows thatSo, the hypothesis that is necessary.Finally, if , then As in The proof of is identical to that of Subsequently, by (31), all components are positive if and only ifNext, is equivalent toas in (a).Special Case. Moreover, if and only if . is even and , then is a binary root by a shortened version of the proof of Theorem 12.By a direct calculation,Since by (31), we have the previous intervals on for positivity and the inequality z‐x , it follows that part (a) of Definition 1 holds for if and only if when and otherwise.Let and assume that . By Remark 5, . Then, holds where by (31), so In particular, and thus Moreover, if , then is also possible since and it follows that or On the other hand, if , then by Remark 5, interval (ii) as follows: . Then, as in (a),as with is identical to that of It follows that all components are positive if and only ifNext,Consequently, if and only ifIt is easy to check thatif and only if Therefore, by (31) and the previous results, fulfills part (a) of Definition 1 if and only if Note that for It follows that if , then the second possibility given above holds with and Let . By Remark 5 as in the proof of , the conditionis equivalent to . Therefore, the second possibility given above holds whenever . However, in this case, can always be maximized at this step to ensure faster convergence since so we can choose of .Finally, if , then On the other hand, suppose that and where is square‐free.Similarly,Finally, is a quadratic equation in with negative discriminant . Since when , we have that is always positive.It follows that the components are positive if and only if .Next, Moreover, () () , and since by assumption , so (d) follows.as in (d).Similarly, , and is always positive.Moreover,We conclude that has positive components such that if and only if In this case, since and thus,Finally, if , then As in (e),As in (d),and is always positive.Next, as in , z .We have that has positive components that satisfy if and only if .In this case, () since As in ,As in (f),and is always positive.Ergo, has positive components if and only if . Next, In this case,

Remark 15. Let be or as in Proposition 6. In view of of Definition 1, we proved by Lemma 13 that for some in or , positive integer , and primitive solution such that one of the following holds:(a′) (b′) and (c′) and However, if , then all reduce to (a), and if , then imply , respectively. In both cases, satisfies Definition 1.
Lemma 13 provides an algorithm for determining matrices . for the descent of any primitive solution of (1). Rephrasing parts of Lemma 13, we have the following simplifications:

Corollary 16. Suppose first that integer satisfies so that (31) holds and (a)For any positive square‐free integer , let Moreover, if is odd, then a second possible choice for is If either choice of is an integer such that , then we have the descent matrix . . Note that in this case, if , then (and STOP).If both choices of fail, then we proceed to (b).(b)Either (i) or (ii):(i)For any positive square‐free integer , let If k is an integer such that , then we have . .Moreover, if and , then . is also a descent matrix.If (i) fails, then we go to (ii).Note that if is even and succeeds where , then there exists a positive integer multiple of that is binary root.(ii)Let . Then, Therefore, if and , then we have . .Otherwise, (ii) fails so proceed to .Either(i) when and or(ii)Let Floor . Then, Thus, if , then we have the descent matrix . .In this case, if , then (and STOP)Note that the case is a consequence of parts (e), and () below.Let’s suppose finally that and (d)In this case, and (e)In this case, and Moreover, if , then (f)In this case, and (g)In this case, and

Example 2. Let and Then, and . By is a generating set for all primitive solutions, and by Corollary 16, we have the following descent:
Since , we start with (a) that checks out, but . Our first descent matrix isReplacing with , we return to (a) where now . Thus, with , we check and find that holds. Our next descent isReplacing with , since , we are back to(a) that checks out, but . Our next descent matrix isReplacing with , since , we return to(a)Both possibilities for fail, so we go to(b)(i) Here, so the next descent matrix is . . , and z‐x Replacing with , since , we are back to(a) checks out, and so we are done with . Our final descent matrix isSummary of Corollary 16 is as follows:By Lemma 10, according to Definition 2 of a generating set, we have the following ascent:

Example 3. Let and (11633613, 6304, 14834125). Then, and .
By Theorem 4, is a generating set for all primitive solutions, and by Corollary 16, we have the following descent:
Summary is as follows:By Lemma 10 and the definition of a generating set, we have the following ascent:

Example 4. Let and (990851891, 18606, 990870511). Then, , and p.
By Theorem 4, is a generating set for all primitive solutions; and by Corollary 16, for even , we have the following descent to primitive binary root .
Summary is as follows:By Lemma 10 and the definition of a generating set, we have the expansion

Example 5. Let and (8311445, 1054, 8354217). Then , and .
By Theorem 4, is a generating set for all primitive solutions, and by Corollary 16, we have the following descent to for even .
Summary is as follows:By Lemma 10, according to the definition of a generating set, we have the expansion

5. Proof of Theorem 4

We first show by Lemma 13 that any primitive solution of (1) satisfies the Fermat’s method of descent with respect to (when 2q‐1‐ ) and with respect to (when ). The interval () will now be expressed as a union of subintervals with the property that if is in the kth subinterval, then there is an element of or such that is a positive integer multiple of a primitive solution as in Definition 1. Since , the subintervals follow directly from those derived in Lemma 13.

Let . Sincethe following descent matrices of Lemma 13 satisfy Definition 1(e) when is in (f) when is in () when is in .Let or 5. Since , the following descent matrices of Lemma 13 satisfy Definition 1:(c) when is in (d) . when is in (e) . when is in (f) . when is in , (g) . when is in .

Let and define for : ] and .

Then,where the following descent matrices of Lemma 13 satisfy Definition 1:(a). when and is in In this case, q‐ floor , so (a) applies to . over the interval (2 ) (2‐1).(b)(i) when and is in ( )]Since , we apply (b)(i) to . over the larger interval (2) < ap (d) < bn < (2 ).(a) when and is in ( (), ()]For is in the next two lines:(b)(3). when is in .(a). when is in the interval that also contains lnt(qs) (with equality holding when is even).(b)(3). when is in (c)(ii) . ) when is in (, (d). when is in ((e). when is in ( ](f). when is in , ](g). when is in ( ).

By Proposition 6 and the interval decomposition of ( ) with corresponding descent matrices, arbitrary primitive solutions of (1) satisfy Fermat’s method of descent with respect to or . Finally, we show that Theorem 4 is a consequence of this result and Theorem 12.

Let be any positive square‐free integer and let be a primitive solution of (1). By the argument mentioned above, there is in or such that satisfies Definition 1. By Lemma 13, if is 2 or 6, then only and (b) of Definition 1 are used in the descent. Moreover, by of Lemma 13 and Theorem 12, the only situation where of Definition 1 occurs is when is even and is a binary root or a copartner of a binary root. In this case, and intertwine indefinitely so the descent is to a root. We assume henceforth that part (c) of Definition 1 does not occur.

Replacing with and continuing by induction, we construct a sequence of primitive solutions of (1). In view of our assumption on part (c) of Definition 1, we wish to show that there exists such that (i.e., ). Suppose by way of contradiction, that for all . We first show that for some .

Since Lemma 13 holds for any positive square‐free integer , we may assume without loss of generality that and consider two cases on :

Case 16. Suppose that is not in(i.e., () and () of Lemma 13). Then, by Lemma 13, there exists an element of or and a primitive solution such that for some positive integer ; and moreover, (so that ).

Case 18. Let’s assume on the other hand that is in (92). By Lemma 13, there exists in or such that satisfies Definition 1 with and (since ). By Remark 7, the parametric representation of (, ) is of the same type as that of . Furthermore, by Remark 8, if , then , and therefore,It follows thatIf is also in (92), then for and 2, we replace with as mentioned above.
In this case, andContinuing in this way, since the are positive integers, there exists such that is in (92) , p‐2, but is not in (92), and by Case 16, . It follows that and the conjecture on in general is established.
Repeating the previous argument with in place of , we have that for some . Continuing in this manner, we construct a strictly decreasing sequence of positive integers which is impossible; so for some N.
We deduce that either is a binary root (or a copartner of a binary root) for some or the sequence descends to .
Conclusion to the proof of Theorem 4 is given as follows: Let be a square‐free positive integer, or and suppose that is a primitive solution to (1). We will show that satisfies Definition 2 of a generating set by using the proof mentioned above to determine integers in in and positive integer such that is in for the descentwhere is either or a primitive binary root, and . Taking inverses by Lemma 10, we then have where is the square of the product of the terms (d‐2 )/ over defined above that are strictly less than . The coefficient of is 1 whenever the product is over the empty set. Finally, since is primitive and the left side is an integer triplet, the coefficient of must be a positive integer and hence is a generating set.

6. Trees of Primitive Solutions

A tree of the primitive solutions to (1) is an infinite network of nodes where each node branches (in our case via ascent matrix multiplications) to a number of subsequent nodes, with the totality giving all and only primitive solutions without duplication. By Theorem 4, trees exist when is 2, 6, or any odd square‐free positive integer. For any other even square‐free , the primitive solutions are attained from a finite forest of such trees.

Specifically, for any given node , there is a unique path via descent matrices back through the tree to either primitive binary root, i.e., if is not a root, then exactly one of the matrices in or exists such that produces a new node that satisfies Definition 1.

In the classical case , the tree of primitive solutions is derived by simply taking all possible ascending products of three generators stemming . This is possible since products always produce distinct primitive solutions in this case. For , families of generators are defined for the primitive solutions that satisfy the requirements for a tree structure with four exceptions that may easily be remedied by adjusting or removing improper branches.

Let denote or , and let . be in G. Reversing the descent notation of Definition 1, assume that is a primitive solution of (1), and, as in the proof of Theorem 4, . . satisfies the Fermat’s descent method for some positive integer . Unlike the case , it is necessary to consider the following anomalies:(a1) The components of may not all be positive.(a2) The components of may be positive but not relatively prime.

Example 6. Let . Then, and so by Theorem 12, is a primitive binary root. Moreover, since , by Theorem 4, is a generating set the primitive solution to (1) and the first level of its corresponding tree of solutions isThe first node satisfies and must be pruned. The second, third, and fourth nodes satisfy so their common divisors 5, 25, and 9 must be dropped. Consequently, there are two paths to (13, 6, 23) which we show in (a4)(ii) below always corresponds to and when they exist. Thus, by convention, we keep the node with and eliminate the other one.The next situation does not occur with the predetermined generators of parametric interval descent but may arise when taking all possible products in the ascending development of a tree. In , we must again prune . In practice, one simply checks each new node for the adverse conditions.(a3) For some odd square‐free , there may exist in such that the binary root conditions and in part (c) of Definition 1 hold:

Example 7. Let be odd, , and . . Then , and since by the definition of ‐z [d‐ (2q‐] (a4) There are duplicate nodes in the first level of the derived tree that must be pruned. They arise from the subsetsfor some primitive root defined as follows:(i) odd square‐free , the nodes in the abutting sets agree when :since (ii)For even square‐free and standard binary root as defined in Theorem 12, there exists a unique in such that

Proof. Since in Theorem 12, uniqueness of will follow from the definition of . For the proof of (ii), we will need an analog of the statementgiven in Theorem 12. Taking inverses by Lemma 10, it follows thatBy an argument similar to the proof of the statement given above from Theorem 12,Moreover, by Lemma 10 again,Finally, by (103) and (105), we have the integer equationsDividing both sides by their gcds, (ii) follows.When is odd, duplicate nodes may also be a consequence of distinct paths from to a common node, that are initiated by the generators given above:(iii)The interval decomposition in the proof of Theorem 4 is disjoint except the intervals corresponding to the descent matrices . and when is odd. If is a primitive solution to (1) such that is in the intersection of these intervals, then there exist two distinct paths from to .

Example 8. Example 6 provides a one‐step illustration of (a4)(ii).
For (a4)(iii), let and . Then, and . and , the previous intersection is approximately and we obtain the following distinct paths from to :We then select the first path with last ascent matrix having by convention and prune the branch including and emanating from on the second path.

7. Conclusion

By the bxn‐interval decomposition of () in the proof of Theorem 4, the only way that distinct paths may arise from to is by (a4). Moreover, the only nontrivial anomalies when is even are (a1), (a2), and (a4)(ii). By the parametric interval method of descent, after some modifications at each level, the primitive solutions of (1) satisfy requirements for one or more tree structures with generating sets or

Data Availability

No data were used to support the findings of this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Supplementary Materials

A supplementary file contains a Mathematica program for any square‐free positive integer and primitive solution of the Diophantine equation that computes directly from Theorem 4: a decomposition of a positive multiple of into a product of generators acting on either or a primitive binary root. As an alternative to the algorithm of Corollary 16, SqFr is executed with Examples 25 and the results are then checked with the definition of a generating set and compared with Corollary 16. Moreover, SqFr determines the decomposition of Example 8 (a4)(iii). (Supplementary Materials)