RECURSIVE ENUMERATION OF PYTHAGOREAN TRIPLES



Similar documents
Pythagorean Triples. becomes

Congruent Number Problem

PYTHAGOREAN TRIPLES KEITH CONRAD

4.2 Euclid s Classification of Pythagorean Triples

SYSTEMS OF PYTHAGOREAN TRIPLES. Acknowledgements. I would like to thank Professor Laura Schueller for advising and guiding me

Math 115 Spring 2011 Written Homework 5 Solutions

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

Math 55: Discrete Mathematics

MATH10040 Chapter 2: Prime and relatively prime numbers

Page 331, 38.4 Suppose a is a positive integer and p is a prime. Prove that p a if and only if the prime factorization of a contains p.

Math 319 Problem Set #3 Solution 21 February 2002

CS 103X: Discrete Structures Homework Assignment 3 Solutions

of Nebraska - Lincoln

k, then n = p2α 1 1 pα k

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Solution to Exercise 2.2. Both m and n are divisible by d, som = dk and n = dk. Thus m ± n = dk ± dk = d(k ± k ),som + n and m n are divisible by d.

Mathematical Induction. Lecture 10-11

11 Ideals Revisiting Z

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

THE CONGRUENT NUMBER PROBLEM

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Sample Induction Proofs

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

Combinatorial Proofs

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

ON FIBONACCI NUMBERS WITH FEW PRIME DIVISORS

Basic Proof Techniques

PRIME FACTORS OF CONSECUTIVE INTEGERS

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.

Pythagorean Triples and Rational Points on the Unit Circle

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

Continued Fractions and the Euclidean Algorithm

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

arxiv: v2 [math.ho] 4 Nov 2009

Settling a Question about Pythagorean Triples

About the inverse football pool problem for 9 games 1

Homework until Test #2

Mathematical Induction

Sequence of Numbers. Mun Chou, Fong QED Education Scientific Malaysia

SCORE SETS IN ORIENTED GRAPHS

PYTHAGOREAN TRIPLES M. SUNIL R. KOSWATTA HARPER COLLEGE, ILLINOIS

Some practice problems for midterm 2

MATH 289 PROBLEM SET 4: NUMBER THEORY

Continued Fractions. Darren C. Collins

Computing exponents modulo a number: Repeated squaring

A Study on the Necessary Conditions for Odd Perfect Numbers

SECTION 10-2 Mathematical Induction

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

Alex, I will take congruent numbers for one million dollars please

10.2 Series and Convergence

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: b + 90c = c + 10b

PowerScore Test Preparation (800)

Pythagorean vectors and their companions. Lattice Cubes

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

INCIDENCE-BETWEENNESS GEOMETRY

Today s Topics. Primes & Greatest Common Divisors

On the largest prime factor of x 2 1

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

STUDENT S SOLUTIONS MANUAL ELEMENTARY NUMBER THEORY. Bart Goddard. Kenneth H. Rosen AND ITS APPLICATIONS FIFTH EDITION. to accompany.

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Handout #1: Mathematical Reasoning

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

PROOFS BY DESCENT KEITH CONRAD

ODD PERFECT NUMBERS HAVE AT LEAST NINE DISTINCT PRIME FACTORS

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

On continued fractions of the square root of prime numbers

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

Solutions for Practice problems on proofs

Our Primitive Roots. Chris Lyons

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

The last three chapters introduced three major proof techniques: direct,

with functions, expressions and equations which follow in units 3 and 4.

SUM OF TWO SQUARES JAHNAVI BHASKAR

The Pointless Machine and Escape of the Clones

arxiv:math/ v1 [math.co] 21 Feb 2002

SOLUTIONS FOR PROBLEM SET 2


Number Theory: A Mathemythical Approach. Student Resources. Printed Version

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

26 Integers: Multiplication, Division, and Order

3. Mathematical Induction

mod 10 = mod 10 = 49 mod 10 = 9.

Regular Languages and Finite Automata

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

THE BANACH CONTRACTION PRINCIPLE. Contents

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY

POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS

The application of prime numbers to RSA encryption

Theorem3.1.1 Thedivisionalgorithm;theorem2.2.1insection2.2 If m, n Z and n is a positive

Pearson Algebra 1 Common Core 2015

Student Outcomes. Lesson Notes. Classwork. Discussion (10 minutes)

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Stationary random graphs on Z with prescribed iid degrees and finite mean connections

AMBIGUOUS CLASSES IN QUADRATIC FIELDS

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Transcription:

RECURSIVE ENUMERATION OF PYTHAGOREAN TRIPLES DARRYL MCCULLOUGH AND ELIZABETH WADE In [9], P. W. Wade and W. R. Wade (no relation to the second author gave a recursion formula that produces Pythagorean triples. In fact, it produces all Pythagorean triples (a, b, c having a given value of the height, which is defined to be h = c b. For the cases when h is a square or twice a square, they gave a complete proof that the recursion generates all Pythagorean triples. In this note, we give a quick proof of this for all values of h, using a formula that gives all Pythagorean triples. We call the formula the height-excess enumeration because its parameters are the height and certain multiples of the excess e = a + b c. This enumeration method appears several times in the literature, but does not seem to be widely known. We will discuss these origins after giving the formula. A more extensive treatment of the height-excess enumeration and other applications of it appear in [7]. To set terminology, a Pythagorean triple (PT is an ordered triple (a, b, c of positive integers such that a 2 + b 2 = c 2. A PT is primitive when it is not a multiple of a smaller triple. A PT with a < b is called a Pythagorean triangle. A number is called square-free if it is not divisible by the square of any prime number. Height-Excess Enumeration Theorem. To a positive integer h, written as pq 2 with p square-free and q positive, associate the number d equal to 2pq if p is odd, and to pq if p is even. As one takes all pairs (h, k of positive integers, the formula P (k, h = (h + dk, dk + (dk2 (dk2, h + dk + produces each Pythagorean triple exactly once. The primitive Pythagorean triples occur exactly when gcd(k, h = 1 and either h = q 2 with q odd, or h = 2q 2. The Pythagorean triangles occur exactly when k > h d 2. Notice that h is the height and dk is the excess of P (k, h. Figure 1 shows geometric interpretations of h and k. The number d is called the increment. Table 1 shows the first 12 PT s of height h when h is 1, 2, 81, and 162, with the primitive PT s indicated by an asterisk. Date: July 5, 2002. The first author was supported in part by NSF grant DMS-0102463. 1

2 DARRYL MCCULLOUGH AND ELIZABETH WADE Figure 1. Height and excess of a Pythagorean triangle. h = 1 h = 2 h = 81 h = 162 (3, 4, 5* (4, 3, 5* (99, 20, 101* (180, 19, 181* (5, 12, 13* (6, 8, 10 (117, 44, 125* (198, 40, 202 (7, 24, 25* (8, 15, 17* (135, 72, 153 (216, 63, 225 (9, 40, 41* (10, 24, 26 (153, 104, 185* (234, 88, 250 (11, 60, 61* (12, 35, 37* (171, 140, 221* (252, 115, 277* (13, 84, 85* (14, 48, 50 (189, 180, 261 (270, 144, 306 (15, 112, 113* (16, 63, 65* (207, 224, 305* (288, 175, 337* (17, 144, 145* (18, 80, 82 (225, 272, 353* (306, 208, 370 (19, 180, 191* (20, 99, 101* (243, 324, 405 (324, 243, 405 (21, 220, 221* (22, 120, 122 (261, 380, 461* (342, 280, 442 (23, 264, 265* (24, 143, 145* (279, 440, 521* (360, 319, 481* (25, 312, 313* (26, 168, 170 (297, 504, 585 (378, 360, 522 Table 1. The first 12 PT s for heights 1, 2, 81, and 162. The primitive PT s are starred. As far as we can determine, the first use of the height and excess as parameters to enumerate PT s was by M. G. Teigan and D. W. Hadwin in [8]. The parameters used there are x = h, y = e2 (which, being c a, is the height of (b, a, c, and z = e. A similar method is found in [6]. The height-excess enumeration is implicit in [9], and explicit versions of it appear in [2] and [10]. We present a proof of the Height-Excess Enumeration Theorem in section 1. In section 2, we derive the Wade-Wade recursion formula, and in section 3, we briefly discuss another recursion formula for PT s, involving a generalized Fibonacci sequence, from the height-excess viewpoint. 1. Proof of the Height-Excess Enumeration Theorem We first develop the key properties of d. As usual, the notation x y means that the integer y is divisible by the integer x. Lemma. Let h be a positive integer with associated increment d. d 2. If D is any positive integer for which D 2, then d D. Then

RECURSIVE ENUMERATION OF PYTHAGOREAN TRIPLES 3 Proof. If p is odd, then d 2 = 4p 2 q 2 = 2p. If p is even, say p = 2p 0, then d 2 = 4p 2 0 q2 = p 0. So d 2. For the second assertion of the Lemma, write D in terms of its distinct prime factors, D = d r 1 1 dr k k, so that D 2 = d 2r 1 1 d 2r k k. Similarly, write p = p 1 p m and q 2 = q 2t 1 1 qn 2tn. When D 2, each q i must equal a d j, with their exponents satisfying 2t i 2r j and hence t i r j. This shows that q D, say D = q D 1 where D 1 = s u 1 1 su l l. Since 2pq 2 D 2 and D 2 = q 2 D1 2, we have 2p D2 1. So each p i is one of the s j, showing that p D 1. Also, if p is odd, then since 2p D1 2, 2 is one of the s j, so 2p D 1. So pq D, and if p is odd, then 2pq D. That is, d D. Now we prove the Theorem. By the Lemma, the coordinates of P (k, h are positive integers, and using basic algebra one can verify that they satisfy the Pythagorean relation. Using h = c b, e = a+b c, and the Pythagorean relation, more algebra shows that for any PT, (a, b, c = (h + e, e + e2, h + e + e2. The Pythagorean relation implies that e 2 = 2(c a(c b, so e 2. By the Lemma, e is divisible by d. So every PT equals some P (k, h. Since any PT determines h and e uniquely, it also determines k uniquely, so it can equal only one P (k, h. We note that P (k, h is a triangle exactly when h + dk < dk + (dk2, which says that k > h d 2, so it remains only to establish the criterion for P (k, h to be primitive. We will first show that if (a, b, c is primitive, then c a and c b are relatively prime. If r were a prime dividing both of them, then r would divide the sum (c a 2 + (c b 2 = (3c 2a 2bc. Now r could not divide c, since then it would divide a and b and (a, b, c would not be primitive. So r divides 3c 2a 2b = 2(c a + 2(c b c, again giving the contradiction that r divides c. We conclude that c a = k 2 d2 and c b = h are relatively prime. For p odd, these are 2pk 2 and pq 2, so p = 1, q is odd, and gcd(2k, q = 1. For p even, they are k 2 p 2 and pq2, so p = 2 and gcd(k, 2q = 1. Conversely, suppose that h and k satisfy the given conditions. For h = q 2, (a, b is (q(q + 2k, 2k(q + k. If r is a prime dividing both entries, then r 2 since the first entry is odd. So r must divide q or q + 2k, and must divide k or q + k. Any of the four possible combinations leads to r dividing both q and k, a contradiction. For h = 2q 2, (a, b is (2q(k + q, k(2q + k and the reasoning is similar. 2. The Wade-Wade recursion formula Simple recursion formulas for generating PT s of a fixed height have long been known. An early example is [1], which provides recursions that

4 DARRYL MCCULLOUGH AND ELIZABETH WADE start with a PT and produce some but not usually all of the other PT s with the same height. P. W. Wade and W. R. Wade [9] gave a recursion formula which generates all PT s of height h, verifying this fully for the cases when h is of the form q 2 or 2q 2. Using the Height-Excess Enumeration Theorem, we will verify their recursion formula for all h. Putting (a k, b k, c k = (h + dk, dk + (dk2 (dk2, h + dk +, we have (d(k + 12 (a k+1, b k+1 = (h + d(k + 1, d(k + 1 + = (h + dk + d, dk + d + (dk2 + dk d h + d2 = (a k + d, dh a k + b k + d2. so (a k+1, b k+1, c k+1 = (a k + d, d h a k + b k + d2, d h a k + c k + d2. If we start with (a 0, b 0, c 0 = (h, 0, h, this recursion produces exactly the triples in the Theorem that have height h first the finitely many PT s of height h that are not Pythagorean triangles, and then, once k exceeds h d 2, the infinitely many Pythagorean triangles of height h. The triples in table 1 were calculated using the Wade-Wade recursion formula and Mathematica. 3. PT s and Fibonacci-like sequences Other recursive methods for producing PT s have been developed. For example, the following method based on a generalized Fibonacci sequence was given by Horadam [3, 4]. Start with positive integers r and s. Put H 1 = r, H 2 = s, and H n = H n 1 + H n 2 for n 3. The triples (2H n+1 H n+2, H n H n+3, 2H n+1 H n+2 + H 2 n are PT s with a even. Using the Fibonacci identity, this triple can be written as (2H 2 n+1 + 2H n H n+1, H 2 n + 2H n H n+1, H 2 n + 2H n H n+1 + 2H 2 n+1 which is exactly P (H n, 2Hn+1 2. Notice that in any primitive PT, c is odd and exactly one of a and b is odd, so a is even if and only if the height is even. So the primitive PT s with a even are exactly the P (k, 2q 2 with k and 2q relatively prime. As noted in [3], these are Horadam PT s with H 1 = k and H 2 = q. Now, H n and H n+1 are relatively prime if and only if r and s were relatively prime, so the Horadam PT is primitive exactly when r and s were relatively prime and H n is odd. If r and s are relatively prime and H n is even, then H n+1 is odd and H n /2 and H n+1 are relatively prime. Thus, P (H n /2, Hn+1 2 is primitive, and one finds that 2P (H n/2, Hn+1 2 = P (H n, 2Hn+1 2, so the Horadam triple is 2 times a primitive PT (note that

RECURSIVE ENUMERATION OF PYTHAGOREAN TRIPLES 5 in general, however, m P (k, h P (mk, mh, for example P (1, 2 = (4, 3, 5 but P (2, 4 = (12, 16, 20. It would be interesting to see whether some of the more sophisticated Fibonacci recursion methods for producing triples, such as that of [5], can be analyzed using the height-excess enumeration. References 1. P. J. Arpaia, A generating property of Pythagorean triples, Math. Magazine 44 (1971, 26-27. 2. B. Dawson, The ring of Pythagorean triples, Missouri J. Math. Sci. 6 (1994, 72-77. 3. A. F. Horadam, A generalized Fibonacci sequence, Amer. Math. Monthly 68 (1961, 455-459. 4. A. F. Horadam, Fibonacci number triples, Amer. Math. Monthly 68 (1961, 751-753 5. A. F. Horadam and A. B. Shannon, A. G., Pell-type number generators of Pythagorean triples, in Applications of Fibonacci numbers, Vol. 5 (St. Andrews, 1992, 331-343, Kluwer Acad. Publ., Dordrecht, 1993. 6. H. Klostergaard, Tabulating all Pythagorean triples, Math. Mag. 51 (1978, 226-227. 7. D. McCullough, Height and excess of Pythagorean triples, preprint. 8. M. G. Teigan and D. W. Hadwin, On generating Pythagorean triples, Amer. Math. Monthly 78 (1971, 378-379. 9. P. W. Wade and W. R. Wade, Recursions that produce Pythagorean triples, College Math. J. 31 (2000, 98-101. 10. M. Wójtowicz, Algebraic structures of some sets of Pythagorean triples, II, Missouri J. Math. Sci. 13 (2001, 17-23. Department of Mathematics, University of Oklahoma, Norman, Oklahoma 73019, USA E-mail address: dmccullough@math.ou.edu URL: www.math.ou.edu/ dmccullo/ School of Law, Duke University, Durham, North Carolina, 27708, USA E-mail address: lwade@nc.rr.com