# Full text of "Number Theory & its History"

## See other formats

ftoiT & 8& \%1 n. i nu eim i rnc - [] JY}!/ '--r 8| 10 j* ftos \ Cms iQ v -r t?" b'll Ifr NAME This book is due for return on or before the last date shown above, voM 'if NUMBER THEORY AND ITS HISTORY Abacist vs. Atgorismisl From Gregor Rds<;h: Margarita Philosophic* Strasbourg 1504 NUMBER THEORY AND ITS HISTORY By Oystein Ore STEMMING PHOFKSSOtt tit M.VTHKM ATtCS YALE UNIVERSITY 1NKW TOKK T OttO IN TO LOMHJiN Mt G RAW- IT ILL BOOK COMPANY, TNC ! 9 4 8 NUMBER THEORY AND TTS HISTORY Copyright, 1948, by the McCravv-1 1 ill Book Company, Tnn. Printed in the United States of Ameriaa. All rights reserved. This book, or parts thereof, may not be reproduced in any form without permission of the publishers. VI PREFACE This book is based upon a course dealing with the theory of numbers and its history which has been given at. Yale for several years, Although the course has been attended primarily by college students in their junior and senior years it has been open to all interested. The lectures were intended to give the principal ideas and methods of number theory as well as their historical back- ground and development through the centuries. Most texts on number theory contain inserted historical notes but in this course I have attempted to obtain a presentation of the results of the theory integrated more fully in the historical and cultural frame- work. Number theory seems particularly suited to this form of exposition, and in my experience it lias Contributed much to making the subject more informative as well as more palatable to the students. Obviously, only some of the main problems of number theory could be included in this book. In making a selection, topics of systematic and historical importance capable of a simple presenta- tion have been preferred. While many standard aspects of number theory had to be discussed , the treatment is often new, and much material has been added that lias not heretofore made its appear- ance in texts. Also, in several instances I have found it desirable to introduce and define modern algebraic concepts whose useful- ness is readily explained by the context. The questions of number theory are of importance not only to mathematicians. Now, as in earlier days, these problems seem to possess a particular attraction for many laymen, and number theory is notable as one of the few fields of mathematics where the suggestions and conjectures of amateurs or nonprofessional mathe- maticians have exerted an appreciable influence. It may be men- tioned incidentally that there have been few college classes that I can recall in which there were not to be found some students VI PREFACE who had already played with the strange properties of numbers. To make the theory available to readers whose mathematical knowledge may be limited, every effort has been made to reduce to a minimum the technical complications and mathematical requirements of the presentation. Thus, the book is of a more elementary character than many previous texts, and for the under- standing of a greater part of the subject matter a knowledge of the simplest algebraic rules should be sufficient. Only in some of the later chapters has a more extended familiarity with mathe- matical manipulations been presupposed. T am indebted to Prof. Otto Neugcbauer for valuable comments on the historical material and to Paul T. Bateman for numerous suggestions for mathematical improvements that have been em- bodied in the text. In reading the proofs I was assisted by M. Gerstenhabcr and E. V. Schenkman, who have also checked the numerical computations. Oybtein Ore NEW Havkx, Con's 7 . August, 1948 CONTENTS Preface Chapter 1. Counting and Recording of Numbers Number and counting , 1 Basic number groups , . 1 The number systems 2 Large numbers , 4 5. Finger numbers .,...,.,.. 5 fi. Recordings of numbers 6 7. Writing of numbers , , 8 8. Calculations 14 Positional numeral systems 16 if. Hindu-Arabic numerals 1!) Chapter 8, Properties of Numbers. Division 1. Number theory and numerology . 25 2. Multiples and divisors 2S 3. Division and remainders 30 4. Number systems 34 5. Binary number systems 37 Chapter S. Euclid's Algorism [ 1, Greatest common divisor. Euclid's algorism .......... 41 . 2. The division lemma . 44 3. Least common multiple . 45 I 4. Greatest common divisor and least common multiple for several 1 numbers 47 Chapter / h Prime Numbers 1. Prime numbers and the prime factorization theorem 50 2. Determination of prime factors 52 yuj CONTENTS 3. Factor tables * ' ' 53 4. For mat' a factorization method - • ■ ■ «4 5. Euler's factorization method . ™ $. The sieve of Eratosthenes 69 7. Mersenne arid Format primes - 8. The distribution of primes **> Chapter B, fh$ Aliquot Parts 1. The divisors of a number 2. Perfect numbers . . . . 3. Amicable numhei Sfi . yi 06 4. Greatest common .divisor and least common multiple 100 5. Euler's function 10S) Chapter 0. Indeterminate Problems 1. Problems and puzzles 2. Indeterminate problems .- . , . 8. Problems with two unknowns * 124 4. Problems with several unknowns , 131 Chapter 7. Theory of Linear Indeterminate Problems 1. Theory of linear indeterminate equations wil.li two unknowns ... H2 2. Linear indeterminate equations in several unknowns 153 3. Classification of systems of numbers , . . . , - - . 158 Chapter 8. Diopkantine Problem* 1. The Pythagorean triangle • li86 2. The Plimpton Library tablet l«J 3. Diophantos of Alexandria . , 1 71) 4. Al-Karkhi and Leonardo Pisano l8-> 5. From Diophantos to Format *** 6. The method of infinite descent w? 7. Fennat's last theorem , ^ CONTENTS ix Chapter y. Cm§rmm&& J. The Disquisitiones arithmetieae . ,..«.,, 209 2. Trie propeHios of fiongrueiices 211 3. Residue systems 213 4. Operations with congruences ,,,,,....,.,..... 216 5. Casting out nines 225 Chapter 10. Analysis of Congruences 1. Algebraic congruences . 234 2. Linear congruences . , - 8f0 3. Simultaneous congruences ami the Chinese remainder theorem . 24J1 4. Further study of algebraic congruences ,..,.,.,...,. 249 Chapter 11. Wilson's Theorem ami Its Consequences 1. Wilson's theorem 250 2. Gauss's generalization of Wilson's theorem 263 3. Representations of numbers m the sum of two squares 267 Chapter IS- Ruler's Theorem and. lis Consequence* L Euler's theorem 272 2. Format's theorem 277 3. Exponents of numbers 279 4. Primitive roots for primes 2S4 5. Primitive roots for powers of primes .,.....,,.,... 2H5 6. Universal exponents 290 7. Indices 291 S. -Number theory and the splicing of telephone cables 302 Chapter 13. Theor-/ of Decimal tizpan-sions 1. Decimal fractions ,,,,,..,..,.... 311 2. The properties of decimal fractious 315 Chapter 14. The Converse of Fer mat's Tficorem 1. The converse of Fermat'a theorem 326 2. Numbers with the Format property 331 x CONTENTS Chapter tS. TM Clawiral Crm,strudim Problems 1. The classical r;on^trud.ion problems ™ 2. The construction of regular polygons 3-16 3. Examples of cnnstruntibJo polygons 3o2 Supplement, .......,.-■ ■"<' Bibliography. . , - ' iml General Name Index * ■ - - "' (,i Subject Index 3(io CHAPTER 1 COUNTING AND RECORDING OF NUMBERS 1-1. Numbers and counting. All the various forms of human culture and human society, even the most rudimentary types, seem to require some concept of number and some process for counting. According to the anthropologists, every people has some terminology for the first numbers, although in the most primitive tribes this may not extend beyond two or three. In a general way one can say that the process of counting consists in matching the objects to be counted with some familiar set of objects like fingers, toes, pebbles, sticks, notches, or the number words. It may be observed that the counting process often goes considerably beyond the existing terms for numerals in the language. 1-2. Basic number groups. Almost all people seem to have used their fingers as /the most convenient and natural counters. In many languages this is easily recognized in the number termi- nology. In English we still use the term digits for the numerals. For numbers exceeding 10 the toes have quite commonly been used as further counters. Very early in the cultural development it became necessary to perform more extensive counts to determine the number of cattle, of friends and foes, of days and years, and so on. To handle larger figures the counting process must be systematized. The first step in this direction consists in arranging the numbers into convenient groups. The choice of such basic groups depends naturally on the matching process used in counting. The great preponderance of people use a basic decimal or decadic group of 10 objects, as one should expect from counting on the 1 2 NUMBER THEORY AND ITS HISTORY fingers. The word for 10 often signifies one man. Quinary systems based on groups of 5 or one hand also occur, but the vigesimal systems based on a 20 group are much more common, corresponding of course to a complete count of fingers and toes. Among the American Indian peoples the vigesimal system was in wide- spread use; best known is the well-developed Mayan system. One finds traces of a 20 system in many other languages. We still count in scores. The French quatre-vingt for 80 is a remnant of a previously more extensive 20 count. In Danish the 20 system is still used systematically for the names of numbers less than 100. The largest known basic number, 60, is found in the Babylonian sexagesimal system. It is difficult to explain the reasons for such a large unit group. It has been suggested by several authors that it is the result of a merger of two different number systems. We still use this system when measuring time and angles in minutes and seconds. "Other basic numbers than those mentioned here are quite rare. We may detect a trace of a 12 or duodecimal system in our counts in dozens and gross. Certain African tribes use basic groups of 3 and 4. The binary or dyadic system, in which 2 or a pair is the basic concept, has been used in a rudimentary form by Australian indigenes. The dyadic system is, however, a system whose simple properties often have a special mathematical use- fulness. 1-3. The number systems. When the basic counting group is fixed, the numbers exceeding the first group would be obtained by counting afresh in a new group, then another, and so on. For instance, in a quinary sj^stem where the basic five group might be called one h(and), one would count one h. and one, one h. and two, 2h. (10), 3h. and 2 (17), and so on. After one had reached five hands (25), one might say hand of hands (h.h.) and begin over again. So as an example, one would denote 66 by 2hh and 3h and 1, that is, 2 X 25 + 3 X 5 + 1. Clearly this process can be extended indefinitely by introducing higher groups hhh = 125 = 5 3 , hhhh = 625 = 5 4 COUNTING AND RECORDING OF NUMBERS 3 In this manner one arrives at a representation of any number as an expression a n • 5 n + an _x • 5 n_1 + • • • + a 2 • 5 2 + ai • 5 + a (1-1) where each coefficient a,{ is one of the numbers 0, 1, 2, 3, 4. To be quite correct, one should observe that this particular example historically is fictitious, since no people is known to have developed and used a completely general system (1-1) with the base 5. But this systematic procedure for the construction of a number system was certainly the guiding principle in the evolution of our decadic number system and of many other systems. To confirm this assertion further one can turn to the philological analysis of our number terms. Through the laws of comparative linguistics one can trace a word like eleven to one left over, and similarly twelve to two over. There is some indication that our fundamental word ten may be derived from an Indo-European root meaning two hands. The word hundred comes from an original term ten times (ten). It is further interesting to note that the names for thousand are unrelated in the various main branches of the Indo-European languages; hence it is probably a rather late construction. The word itself seems to be derived from a Proto- Germanic term signifying great hundred. In our decadic system all numbers are put in a form analogous to (1-1) a n • 10 w H + a 2 • 10 2 + a x • 10 + a (1-2) where the coefficients take values from to 9. In general, in the subsequent chapters, we shall understand by a number system with the base b a system in which we represent the numbers in the form a n • b n + • • • + a 2 • b 2 + ax • b + a (1-3) where the coefficients a* are numbers from to b — 1. It should be mentioned that relatively few peoples developed their number systems to this perfection. Also, in many languages one finds other methods for the construction of numbers. As an example of irregular construction let us mention that in Welsh the 4 NUMBER THEORY AND ITS HISTORY number words from 15 to 19 indicate 15, 15 + 1, 15 + 2, 2 X 9, 15 + 4. Subtraction occurs often as a method; for instance, in Latin, un-de-viginti = 20 — 1 = 19, duo-de-sexaginta = 60 — 2 = 58. Similar forms exist in Greek, Hindu, Mayan, and other languages. The Mayan number system was developed to unusually high levels, but the system has one peculiar irregularity. The basic group is 20, but the group of second order is not 20 X 20 = 400 as one should expect, but 20 X 18 = 360. This appears to be connected with the division of the Mayan year into 18 months each consisting of 20 days, supplemented with 5 extra days. The higher groups in the system are 360 X 20, 360 X 20 2 , • • • 1-4. Large numbers. As one looks at the development of number systems in retrospect it seems fairly simple to construct arbitrarily large numbers. However, in most systems the span of numbers actually used is very limited. Everyday life does not require very large numbers, and in many languages the number names do not go beyond thousands or even hundreds. We mentioned above that the term one thousand seems to have made a relatively late appearance in the Indo-European languages. The Greeks usually stopped at a myriad or ten thousand. For a long period the Romans did not have names or symbols for groups above 100,000. There exists in Rome an inscription on the Columna Rostrata commemorating the victory over Carthage at Mylae in the year 260 b.c. in which 31 symbols for 100,000 were repeated to signify 3,100,000. The Hindus had a peculiar attrac- tion to large numbers, and immense figures occur commonly in their mythological tales and also in many of their algebraic problems. As a consequence, there existed particular names for the higher decadic groups to very great powers of 10. For instance, in a myth from the life of Buddha one finds the denominations up to 10 153 . Even our own number system has not been developed system- atically to this extent. The word for one million is a fairly recent COUNTING AND RECORDING OF NUMBERS 5 construction, which seems to have originated in Italy around a.d. 1400. The concept one billion has not found its final niche in our system. In American and sometimes in French terminology this means one thousand millions (10 9 ) while in most other countries of the world one billion is one million millions (10 12 ), while one thousand millions is called a milliard. It is probably only through the expenditures of the world wars that numbers of this size have reached such common use that confusion is likely to occur. When a billion is defined to be a thousand millions a trillion becomes one thousand billions (10 12 ), a quadrillion one thousand trillions, and so on. On the other hand when a billion is one million millions, one million billions is a trillion (10 18 ), one million trillions is a quadrillion (10 24 ), and so on. While' this discrepancy is not apt to cause any serious misunderstandings in everyday life, some universal agreement on usage and nomen- clature would, nevertheless, be desirable. The intellectual effort that lies behind a systematic extension of the number system is well illustrated by the fact that Archimedes (278-212 b.c), the most advanced Greek mathematician, deems it worth while to devote a whole treatise, The Sand Reckoning, to this purpose. This work is addressed to his relative, King Gelon of Syracuse, and begins as follows: There are some, King Gelon, who think that the number of grains of sand is infinite in multitude; and I mean by the sand not only that which exists about Syracuse and the rest of Sicily, but also that which is found in every region, whether inhabited or uninhabited. Again there are some, who, without regarding it as infinite, nevertheless think that no number has been named which is great enough to exceed its size. Under this guise of aiming at finding a number exceeding the totality of grains of sand in the universe, as then known, Archi- medes proceeds to construct a systematic enumeration method for arbitrarily high numbers. 1-5. Finger numbers. For the communication of numbers from one individual to another it is often desirable to have some other representation than the vocal expressions of the number 6 NUMBER THEORY AND ITS HISTORY names in the language. We now mainly use written numbers, a representation which we shall study subsequently. Before the advent of a fairly general writing ability the finger numbers were widely used as a universal numerical language. The numbers were indicated by means of different positions of fingers and hands. In a rudimentary way we still occasionally express numbers by our fingers. The finger numbers were in use in Europe both in the classical period and in the Middle Ages; they were used by the Greeks, Romans, Arabs, Hindus, and many other people. The human figures in ancient drawings and statues often show peculiar finger positions which denote numbers. For instance, Pliny states that the statue of Janus on the Forum in Rome represented the number 365, the days in the year, on its fingers. In the Orient the finger numbers are still in common use. They enable buyers and sellers in the bazaars to bargain about prices independent of language differences. When the bargainers cover their hands with a piece of cloth, the finger numbers have the added advantage that the negotiations are secret to other parties. Our best information about finger numbers in early times is due to the works of the Venerable Bede (a.d. 673-735), an English Benedictine monk from the cloisters in Wearmouth and Jarrow. His treatise De temporum ratione deals with the rules for calculating the date of Easter, and as an introduction it contains a description of the use of finger numbers (Fig. 1-1) . The finger numbers were probablv only in actual use for fairly moderate figures. Bede's numbers have a natural limit of 10,000, but he enlarges the method rather artificially so that it becomes possible to express numbers up to 1,000,000. To some limited extent it was possible to cal- culate with finger numbers. In Europe they seem to have dis- appeared gradually with the ascendency of the Hindu-Arabic number system. 1-6. Recordings of numbers. Neither the spoken numbers nor the finger numbers have any permanency. To preserve numbers for the purpose of records it is necessary to have other representa- tions. Furthermore, without some memory aids the performance of calculations is extremely difficult. COUNTING AND RECORDING OF NUMBERS Fig. 1-1. Finger numbers. {From. Luca di Burgo Pacioli, Summa de arith- metica geometria, second edition, Venice, 1523. Courtesy of D. E. Smith Collection, Columbia University.) 8 NUMBER THEORY AND ITS HISTORY Many procedures have been devised to record numbers. The method of representing numbers by means of knots tied on strings has been used quite widely, in ancient China and on some of the South Sea Islands, and the quipus of the Incas in Peru are well known. In some localities split bamboo sticks have served as number records. The most natural method for such records seems to con- sist in letting the counting process proceed by indicating each individual item through a mark on some suitable permanent material; for instance, dots or lines drawn in clay or on stones, s:ratches, notches, or scores on wooden sticks, chalk marks on slate or boards, and, of course, our present method of check marks on writing material. The use of wooden tallies for recordings of numbers has been common in most European countries and in isolated districts it still occurs for special purposes. The English words score and count, from computare (putare, to cut), point to such methods. An important function of the tallies was to serve as contracts. In this case the tallies were ordinarily made in duplicate, one for each party, obtained by splitting a single piece of wood in two. Fraud- ulent changes were prevented quite effectively by cutting the number figures simultaneously over both parts. This system reached its highest level in the well-known Exchequer tallies, which formed an essential part of the British official accounting system from the twelfth century on (Fig. 1-2). On the Exchequer tallies the two pieces were unequal; the main piece, called the stock, served as a receipt while the separated, thinner leaf or foil was the record of payment. This tally system remained legally valid in England until the year 1826, and it had its official funeral pyre in 1834 when the burning of the accumulated tallies resulted in the fire that destroyed the old Parliament buildings. 1-7. Writing of numbers. The use; of marks or notches to denote numbers is clearly a primitive form of writing, and it is likely to have been one of the first attempts in this direction. One can still see traces of this original procedure in many systems of number writing, for instance, quite plainly in the Roman numerals COUNTING AND RECORDING OF NUMBERS 9 ; s ■'?'">,. a wggggafrjg Fig. 1-2. Exchequer Tallies. (From H. Jenkimon, Exchequer Tallies, Archae- logica, London, 1011. Courtesy of Society of Antiquaries, London.) 10 NUMBER THEORY AND ITS HISTORY I, II, III, IIII. To facilitate the reading of the tally marks when they became numerous, each basic group would naturally be indi- cated in some special way, for instance, by a cross-notch, which we still use. Through this simple procedure one has already arrived at the essential principle of some of the most important systems of numerals. For the purpose of classification they may be called simple grouping systems. Let us illustrate by a few examples: EARLY EGYPTIAN NUMERALS (3400 B.C.) (Hieroglyphic) 10 100 ii ::: n i 1 1 E X o mp ,e ; fniWnS'.V =13,545 Quite familiar are the symbols of the Roman system: ROMAN NUMERALS 1 2 5 10 50 100 500 1,000 I II V X L C D M Example: MDCCCXXVII = 1,827. The Roman symbols corresponding to 50 and 500 form inter- mediate groupings within the basic decimal system, and they serve to clarify and simplify the writing of numbers. The subtraction principle in Roman numerals whereby a smaller unit preceding a higher one indicates subtraction (for instance, IX = 9, IV = 4), also shortens the representation. It may be mentioned that this COUNTING AND RECORDING OF NUMBERS 11 use of subtraction in a systematic manner is an innovation of the last few centuries; in the classical period or even in medieval times it was used only rarely. Similar simplifications through subtrac- tive notations occur in other numeral systems. The Herodianic Greek numerals belong in principle to the simple grouping type: ATTIC OR HERODIANIC GREEK NUMERALS I 5 10 100 1000 10,000 I r Z\ H X M <-+■■ xph h h z\ ^r 1 1 ••» These symbols are derived from the initials of the Greek numbers: nENTE (5), AEKA (10), HKATON (100) XIAI02 (1,000), MTPIOS (10,000) The simple grouping system in several instances developed into ( a type of numeration that may be called a multiplicative grouping system. In such systems one has special ciphers for the numbers in the basic group, e.g., 1, 2, . . . , 9, and a second class of symbols for the higher groups, e.g., 10 = t, 100 = h, 1,000 = th,--> The ciphers would then be used multiplicati very to show how many of the higher groups should be indicated. This would lead to representations of the type of the example 3,297 = 3th 2h 9t 7 The traditional Chinese- Japanese numeral system is a multipli- 12 NUMBER THEORY AND ITS HISTORY cative grouping as shown in the illustration. It should be noted that the writing is vertical instead of horizontal. 6 yr 7-t CHINESE-JAPANESE NUMERALS Example: 3468 1 — 10 ")" 2 ^~ 100 ^~ 3 ^- 1000 -f" 4 23 <ZS CHINESE MERCANTILE SYSTEM I -10 •) ") x tf 1 ± i k + Fig. 1-3. A third method of number writing may be called a ciphered numeral system. In the case of a decadic system one would denote the numbers from 1 to 9 by special symbols; similarly the multiples of 10 up to 90, the hundreds up to 900, and so on, would have their COUNTING AND RECORDING OF NUMBERS 13 individual signs. All numbers can then be represented as a com- bination of such symbols in a very compact form. The Egyptian hieroglyphic number writing later developed into the hieratic and demotic systems, which most nearly can be classified as being ciphered. Other examples are afforded by Coptic and Hindu Brahmi numerals. HIERATIC NUMERALS 1-9 I II in — «j in ^ -=- ((« 10-90 A A A — *A J}) >1 ^ ^ 100-900 y V ") -) •") m) V ?» (y The usual Greek numerals are of a type that may be called alphabetic. The Greeks ciphered by means of the letters of the alphabet supplemented by a few symbols borrowed from the Semitic. ALPHABETIC GREEK NUMERALS 1-9 <xj876£6 4 7 10-90 i k A /a v j o 7r 9 100-900 p <r t v <p X y/ o> 7? Example '.y>ju/&= 742 The higher units were obtained by special marks on the lower ones; for instance, ,a = 1,000, ,(3 = 2,000 Alphabet numerals were used also by the Hebrews and the Syrians and in early Arabic and Gothic writing. 14 NUMBER THEORY AND ITS HISTORY 1-8. Calculations. Most of the numeral systems that we have mentioned in the preceding are not well suited for calculations, such as addition, subtraction, multiplication, and division. The peculiar difficulties that one encounters in performing these oper- Fig. 1-4. Roman abacus. (From Marcus Welser, Opera historica et philologica, Niirnberg, 1682). ations can easily be ascertained in the; familiar system of Roman numerals. In most cultures the ability to handle computations has been considered an advanced and complicated art. On the other hand such knowledge is essential for the functioning of society when it reaches a certain stage of development; compu- tations are essential for trade and commerce, for bookkeeping and accounting, and for many other purposes. COUNTING AND RECORDING OF NUMBERS 15 One finds as a consequence that devices to facilitate computa- tions are in widespread use in the world. Best known is the abacus or reckoning board. The reckoning board was particularly an instrument of the merchants and tradesmen, and it could be applied universally regardless of differences in languages and numbers. This explains the close resemblance between Roman abaci, the Chinese swanpan, the Japanese soroban, the Russian tschotu. In the main they consist of balls in movable rows or on beads, not essentially different from the frames of balls used in our kindergartens to teach the rudiments of counting and calculation. The only preserved Greek abacus was found on the island of Salamis. It is of a different type, a marble slab with engraved lines and Attic number symbols. There exist several Greek and Roman illustrations of persons using such abaci. The numbers were marked by means of small stones, in Latin calculi, whence the origin of our terms calculus and to calculate. In medieval Europe simplified abaci consisting only of lines, one each for units, tens, hundreds, and so on, were in common use. The abacus pattern could be drawn afresh on paper or parchment each time calcula- tions were to be performed. The patterns could be carved perma- nently on a comptoir board or table, and they were often sewn on tablecloths, hence our word bureau derived from the Latin burra or woolen cloth. These checkered tabulating boards or abaci also originated such well-known terms as exchequer and checks. The process of calculating on these boards was called casting (on the lines), a term that is still preserved in various connections. We shall encounter it later in the ancient checking method for calcu- lations known as casting out nines. The numbers were indicated on the board by means of special markers or counters, in French jetons (casters), or also by means of special reckoning coins stamped for this purpose. The abacus gradually lost ground as the knowl- edge of calculation with Hindu- Arabic numerals was spread. In modern times mechanized calculation has again gained the upper hand in any extended computations through the use of the calcu- lating machine. 16 NUMBER THEORY AND ITS HISTORY 1-9. Positional numeral systems. We shall now turn to the history of our own numeral system in which we express every number by means of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. It belongs to a type of numeral systems which are usually called positional. Such systems are based upon the principle of local value, so that a symbol designates a value or class which depends on the place it- takes in the numeral representation. For instance, in the three numbers 352, 325, and 235, the digit 2 signifies respectively 2, 2 X 10, and 2 X 100. Clearly the positional systems are closely related to the mul- tiplicative grouping systems, and one obtains a positional system from a multiplicative grouping system simply by omitting the special symbols designating the higher class groups. As an example one may consider the Chinese-Japanese numerals. It may be observed, however, that this need not be the historical process through which a positional system originated. The only complication which the positional notation involves lies in the necessity of introducing a zero symbol to express a void or missing class; for instance, 204 is different from 24. The essential discovery in the positional system may be considered to lie in the invention of this symbol. The many advantages of the positional system are not difficult to perceive. First, the numeral notation is very compact and easily readable. Next, it is possible to express arbitrarily large numbers only by the digits in the basic group. Finally, and not least important, in comparison with other systems the execution of calculations in the positional system becomes extremely simple. The positional system is interesting culturally because it affords an illustration of an invention made independently in several civilizations. The earliest known numeral system to embody the principle of position is the sexagesimal Babylonian system, which we have mentioned previously. This system evolved from an earlier Sumerian system (about 3000 B.C.), which was also sexa- gesimal, but whose numeral representation was a simple grouping system. There exists an overwhelming material iof Babylonian COUNTING AND RECORDING OF NUMBERS 17 cuneiform tablets dated from 2000 B.C. to 200 b.c. that throws light upon the customs and institutions of this region. It is ;v i% v Sp~ 2 Fig. 1-5. Chinese-Japanese numerals (brush form). The first column gives the numbers 1-10, the second represents 100, 1,000, 10,000, 100,000,000. The three remaining columns give the examples 3,468, 15,702, and 860,531. surprising that a considerable number of these tablets have been found to be mathematical texts and tables of a rather advanced nature. The .numeral representations in the cuneiform texts use 18 NUMBER THEORY AND ITS HISTORY the symbols J and <^ to denote 1 and 10 respectively. Within the basic 60 group the numbers are written by means of a simple grouping system, for instance, «CF 35 To simplify the writing a subtractive symbol f*~ , lal or minus, is applied, as in the example «7f- = 20-1-19 The numbers exceeding 60 were written according to the positional principle. To illustrate, M'W ^JT^ = * x 6 ° 3 + 28 x 6 ° 2 <TT -^Sll N\ + 52 X 60 + 20 = 319,940 During a considerable part of the time in which they were in use, the Babylonian numerals were deficient because no sign for zero existed. As a consequence, the numeral representation was ambiguous. Often the true value of a number can be decided upon only through the context, although at times the spacing of the symbols may be of assistance. A zero sign does not come into regular use until after 300 b.c. Even so the numeral representa- tion does not become unique since the zero is introduced only within the numeral and not at the end, so that, for instance, W may mean 3 or 3 X 60 or even 3 X 60 2 . The Mayans also achieved the distinction of having created a complete positional numeral system. Their number system, as we have already mentioned, was a vigesimal system with a devia- tion from the normal scheme in that the second number group was 360 = 20 X 18 instead of 400 = 20 2 . In the Mayan numeral system the first four numbers were denoted by dots, for instance, • • • = 3. By crossing four dots one obtained the line , representing 5. The numbers in the basic 20 group were obtained from these two symbols by simple grouping, so that COUNTING AND RECORDING OF NUMBERS 19 A symbol <22> for zero was used systematically as we do. Since the representation of the numerals was vertical, an example would appear as follows: = 7x (I8x2O 2 )+I3x(I8x2O)+0x20 + 10 = 55090 1-10. Hindu-Arabic numerals. Our numerals as we now use them are commonly known as the Hindu-Arabic numerals. Most historical evidence points to India as the country of their origin. To the Arabs who were instrumental in their transmission to Europe, they were known as the "Hindu numbers. " Considerable material on early Hindu numerals is available from manuscripts and inscriptions. Although there is some difference of opinion among the scholars, it seems plausible that the number symbols from which our present digits have developed belonged "to the Brahmi branch of numerals. This was originally a ciphered numeral system with the following first nine symbols: BRAHMI SYMBOLS ( 100 B.C.) 1 2345 6789 - = = v p ( p? c 7? The use of a positional system with a zero seems to have made its appearance in India in the period a.d. 600-800. Around a.d. 800 the system was known among the Arabs in Bagdad and it gradually superseded the older type Arabic numerals. One of the greatest Arab mathematicians of this time was Mohammed ibn Musa al-Khowarizmi, whose work, Al-Jabr wal-Muqabalah, contributed much to the spread of calculations with the new system, first in the Arab world and later in Europe. 20 NUMBER THEORY AND ITS HISTORY This treatise is of interest also because it is believed that its title Al-Jabr has given rise to the term algebra of modern mathematics. Through the Arabs the Hindu numerals were introduced in Europe An interesting early form, the Gobar numerals, appeared in Spain. The name Gobar, or dust, numerals is derived from the Indian custom of calculating on the ground or on a board covered with sand The earliest preserved manuscript using Gobar numerals dates from a.d. 976. The Gobar numerals can also be found on the apices or jetons introduced by Gerbert, later Pope Sylvester II (died a.d. 1003), for calculations on the abacus. GOBAR OR WESTERN ARABIC NUMERALS (1000 A.D.) 123 A 567890 The works of al-Khowarizmi were translated into Latin, and through a perversion of his name the art of computing with Hindu- Arabic numerals became known as algorism. This term took on various other forms; in Chaucer it appears as augrime. The word is still preserved in mathematics, where a repeated calculating process is called an algorism. Other terms have been taken over from the Arabs. The Hindus early denoted the zero by a dot or a circle and used the term sunya, or the void, for it. Translated into Arabic this became as-sifi, which is the common root of the words zero and cipher. During the eleventh and twelfth centuries a number of European scholars went to Spain to study Arab learning. Among them one should mention the Englishmen Robert of Chester and Athelard of Bath, both of whom made translations of al-Khowarizmi's works. Still more important for the spread of the new numerals was the Liber abaci (a.d. 1202), a compendium of arithmetic, algebra, and number theory by Leonardo Fibonacci or Pisano, the only outstanding European mathematician of the Middle Ages. He expresses himself strongly in favor of calculations COUNTING AND RECORDING OF NUMBERS 21 "modi Indorum," which he learned as a boy from Arab teachers in North Africa before returning to his native town of Pisa. Another text which was widely studied was the Algorismus of John of Halifax or Sacrobosco (about a.d. 1250). Through the works of these and other scholars, but probably even more through merchants and trade, the knowledge of the Hindu-Arabic numerals was disseminated. The numerals took a great variety of shapes, some quite different from those now in use, but through the introduction of printing the forms became standardized and have since remained almost unchanged. The transition to the new numerals was a long-drawn-out process. For several centuries there was considerable ill feeling between the algorismists, the users of the new numerals, and the abacists, who adhered to the abacus and the Roman numerals. Tradition long preserved Roman numerals in bookkeeping, coinage, and inscriptions. Not until the sixteenth century had the new numerals won a complete victory in schools and trade. Even as late as the famous work of Nikolaus Copernicus (died a.d. 1543) on the solar system, De revolutionibus orbium coelestium, one finds a strange mixture of Roman and Hindu- Arabic numerals and even numbers written out fully in words. The abacus or counter method of calculation remained in use much longer. To illustrate, let us quote from The Ground of Artes (1540) by Robert Recorde, one of the Englishmen who had most influence on arithmetic: Both names are corruptly written: Arsemetrick for Arithmetic, as the Greeks call it, and Augrime for Algorisme as the Arabians found it; which both betoken the Science of Numbring, for Arithmos in Greek is called number: and of it comes Arithmetick, the Art of Numbring. So that Arithmetick is a Science or Art teaching the Manner and Use of Numbring: This Art may be wrought diversely, with Pen or with Counters. But I will first show you the working with the Pen, and then the other in order. [See Frontispiece.] To complete this brief sketch of the development of our number system, it should be mentioned that the first satisfactory expo- sition of the use of decimal fractions was given by the Flemish 22 NUMBER THEORY AND ITS HISTORY LIBRimARITHMETlCE PRACT1CAE comuniaignores)tibi fiKin medium ftatuera ferretquatenus his con ten cus ad altiorcs fecretiffimafqj naeToqt pofthac fpeculationes trafce das. DI S.Fidelirer ropcifK pre eeptor colendiflime:fed tame adhuc unum ex promiffis reftat declarandu.-quodToTuran obi abduxj't ob/ liuio. MAG.Q^uodefttakC DIS.Inur.fecudothetoricefpopS/ deras prxter haec que difta funrquedam alia:& perpulchras arris cal culatoriae rradere regulas -.quodCnifi tibi moleftu foreOteopere ad/ implere:&hj's finemarithmerice tueimponere velim. MAG. Fa/ ciam ut peris.lao equidem q? nihil ex polhciris obliuioe autnegligen ria tranGs.Primo auce Algorithm!! vulgi plineas:& denarios pro/ te<fbles pandarmutno modo perfiguras numeroru(quas .cifrasvo canOverueoa perdenarios proieftiles quecunq? numeru reprgfenta/ re:addere:fubtraheremulriphcareautdiuidereinfuper& numeriiaii que igrtotiig notos reperire pofljs. Q_uod quanru 8f im'Iiraris 8cio/ cunditaris tibi allaturum Gain fequenribus pacebit, DI S. Eyaer/ gpfermortem ad hacc quantocyus verras* Libriquatti Algbnthmuscumdenarfjs proi«fh'libus:J(eucalcuIaris Tra&atus quintus. Capuulumprimu. MAG. De Numeratione Dreprefemationc numeri cu denarrjs ,piee"tiIibusCquibu» Z ip cifn's urimuOneceflarie funt line? cifrarii repfenratcs loc* candemqj cum ipfis fignificatione habena'a ut infra* Spacia vero fuB lineis contenta refpe&ulinee .pxi'mc fuprapofite me dietatcreprf fentat ut f In linea ifta denarius pofirus/ dece Ggnifi/ cat:fed is qui in fpacio cofiftit/rm quincp reprefenrat. Si igirur numc rum aliqueo. denarios proieetiles reprefentare vblueris : tot denarios fcSm bneam Scfpadoifc exigentia ad numerum ,ppofirum reprefen/ randum ponas: 8f cum. quinq? denarios in linea aliquahabucris:pro ipfis/Ieuan's fi placer in fpacio prbximefuperiori unit ponas. Si ve/ ro in fpacio aliquo duos denarios reperies/ipfis leuaris/unu adlinei immediate fuperioreponas.urhic § Nectefugiatgdigiriapplica/ rionemlinearuGgnificaaone ftaugeri & nunuipoifcAd quacunqj Fig. l-6a. Instructions for computing on the lines in the form of a dialogue between magister and disciple. (From Gregor Reisch, Margarita Philosophica, Strassbourg, 1504.) COUNTING AND RECORDING OF NUMBERS 23 & TRAC..V.ALGOR1THMI CALCVLARIS cnim lineam digitus applicaturtcadem unu ranram fifgnificabit: ncc tuncaliqinferioifc donee digirii depofueris aliqdrcpffntar.ut -ooo— j.reprefentanaq depofito digiro triginta important,Q_uod __ urfingula fkdlim acmodo breuiorifianrin mulriplicarione Kdiuifione huiufcemodi digitj application* pfepe urendu eft, De Additione Capitulum feomdum. D1S. DdirionumCm fallarex dj(?bs>o modo fieri arbirror: utfdli a cetnumerus cui debet fieriaddirio per denarios ad b'neas co perenres ponarur;& fimili modo numerus addendus eiappli cetur. MAG. Oprirnefentis ffiridem exemplo probare porueris. DI S.Sit caufa exempli numerus cuj deber fieri addirio .2 r». ira lo «atus Z5 & numerus addendus. n c.in huncmodumadditus. ff I o De Subtra<ftione, Capitulum. iff- MAG* Ecaliter fubrra<fh'one fades c£ ur cum a quo debet fieri fubtra n c"h'o p lineas competenres ponas :8c ab code numerii fubtra/ hendum fubleuando ro!las/in inferiori inchoado.Si veto nu Weru aliquem a fuperiori proximo fublcua re no poffis:a linea proxi mefibifuprapofira unit auferas/SCilludin lineam qua fubtra Aone? perficere non poruiftiin decern refoluens fubrractjoncm .ppofira per ficics.Exempinfia £\ .^i.auferre voIucro:unumquidcalineainfe rioriaccipio 8c* quattuor in bnea fecuda quero neciuenio. ob hoc unu de linea tertia accipiens/ipfum in lineainferiorcin dree refoluo cinq; feiheer ponendo ad eandem lineam : unum vero ad fpacium fur/urn ut fie it Mo fa Ao dc linea fecunda tollanrur rfimiurcr in fimilibus faciendum eft. De IMultiplicatione Capi'mlum-iir)/ I^AG. I vero aliquem numerum mulriplicare plaeuerir:ipfum ad Ii f neas comperenres ponasrnumcrum aurc muiriplicatem mc/ teretineas:&45quoJiberdcnueromulriplkadofuHato/muI/ riplicanre inregrum refpecftu line? in qua opera ris in loco dexrro aut finjftrodeponas:&idipfumufq5 0esmu!riplicadimrriplicad fueonr irerandii eftin fugioreiniriii fumedo.ut fi caufa exepli to ,iC,pcr.t\ mulriplicarevolueris.2tf.utpmiflumeftad lineas ponant: arcfinli/ nea feciida inclioanres :unu demat :8c ^5 eodc in pane dexrra ad linea eande.^.apponant.ut fie cf> 8c fimili modo dcfmmdo facicndfi eft. uthitc f Er in eade linea digiro rerenro/eu quimfpa^ioinfi-oon pro ximo reperit accipieres:ar,p eodcCqma no inregerfed dimidiuseft) Ru4ntegra,^,fed riKdiecace ejus fcj.j ,in bnea eandc ponam 9 . ut X Fig. l-6b. Examples of computation on the line. ZS A y 24 NUMBER THEORY AND ITS HISTORY mathematician Simon Stevin in his work La Disme (a.d. 1585). John Napier seems to have been one of the first to use the comma or point to separate decimals from the integers as we still do. Bibliography Cajori, F. : A History of Mathematical Notations, The Open Court Publishing Company, Chicago, 1928. : A History of Elementary Mathematics, The Macmillan Company, New York, 1924. Hill, G. E. : The Development of Arabic Numerals in Europe Exhibited in Sixty-four Tables, Clarendon Press, Oxford, 1915. Rouse-Ball, W. W. : A Short Account of the History of Mathematics, Macmillan & Co., Ltd., London, 1940. Smith, D. E. : History of Mathematics, Ginn & Company, Boston, 1923. and L. C. Kabpinski: The Hindu-Arabic Numerals, Ginn & Company, Boston, 1911. CHAPTER 2 PROPERTIES OF NUMBERS. DIVISION 2-1. Number theory and numerology. The properties of the series of natural numbers, one of the basic and most essential con- cepts of mathematics, are the object of the theory of numbers. One finds that there exist many simple rules regarding numbers that are quite easy to discover and not too difficult to prove. However, number theory also includes an abundance of problems whose content can be comprehended and expressed in simple terms, yet whose solution has for centuries defied all mathematical investigation. Other problems whose solutions have been success- fully obtained have yielded only to attacks by some of the most ingenious and advanced methods of modern mathematics. The simplicity in form of its problems and the great variation in the methods and tools for their solution explain the attraction that number theory has had for mathematicians and laymen. The innumerable individual contributions, calculations, speculations, and conjectures bear witness to the continued interest in this field of mathematics throughout the centuries. The origins of the study of number properties go back probably almost as far as counting and the arithmetic operations. It does not take long before it is discovered that some numbers behave differently from others; for instance, some numbers can be divided into smaller equal parts and others not. The operations with fractions lead immediately to the study of divisibility of numbers, the least common multiple, and the greatest common divisor. Other approaches have led to early number-theory questions. The solution of puzzles and amusement problems is one of them. To us who are accustomed to have an easy access to modern 25 26 NUMBER THEORY AND ITS HISTORY diversions it may be difficult to realize the entertainment value that mathematical brain-teasers possessed for earlier generations. A brief revival of this interest may be seen in the great number of problems that circulated in the military camps during the war. This interest was attested by the numerous urgent requests for the correct answers, some from men earnestly interested (others undoubtedly put to settle bets). Many such problems are very old and appear in the earliest sources of mathematical information. The entertainment value of mathematical questions was developed especially by the Hindus. The Hindu mathematician Brahma- gupta (a.d. 588-660) states in one of his works: "These problems are stated merely for pleasure. The wise man can devise a thousand others or he can solve the problems of others by the rules given here. As the sun obscures the stars, so does the man of knowledge eclipse the glory of other mathematicians in an assembly of people by proposing algebraic problems and still more by solving them." According to tradition Bhaskara (about a.d. 1140) wrote his famous Lilavati ("the beautiful"), a collection of problems in poetic form, to comfort one of his daughters. The presentation cf mathematical problems in verse was facilitated by the Hindu custom of using metaphors in the pronunciation of numbers. A symbolic correspondence between numbers and objects or philosophical concepts and ideas was a trait common to many of the ancient cultures. One finds traces of such symbolism in most mythologies, and it is even preserved in some of our popular superstitions in regard to numbers. From this association, it is not a long step to speculations about properties of numbers and their implied relation to the corresponding concepts. Such numer- ological studies permeate the writings of the classical and medieval philosophers. The Pythagorean school (about 500 b.c.) was particularly devoted to symbolic number speculations in philosophy and nature. Their influence was considerable ; even Plato touches upon numerology in several instances in his Republic, while Aristotle warns against arguments based upon such foundations. The later Neo-Pythagoreans tend to ascribe much of their mystical lore to the early school, but it seems certain that they have been PROPERTIES OF NUMBERS. DIVISION 27 under the influence also of other and sometimes even older sources. At present it is extremely difficult to ascribe any rational content to many of these numerological diatribes. To illustrate such passages let us make a few excerpts from a long eulogy on the number 7 from the work, On the Creation of the World, by the prominent Jewish philosopher Philo Judaeus: And such great sanctity is there in the number seven, that it has a preeminent rank beyond all the other numbers in the first decade. For the other numbers, some produce without being produced, others are produced but have no productive power themselves; others again both produce and are produced. But the number seven alone is contemplated in no part. And this proposition we must confirm by demonstration. Now the number one produces all the other numbers in order, being itself produced absolutely by no other; and the number eight is pro- duced by twice four, but itself produces no other number in the decade. Again, four has the rank of both, that is, of parents and offspring, for it produces eight when doubled, and it is produced by twice two. But seven alone, as I said before, neither produces nor is produced, on which account other philosophers liken this number to Victory, who has no mother, and to the virgin goddess, whom the fable asserts to have sprung from the head of Jupiter: and the Pythagoreans compare it to the Ruler of all things. ... Among the things then which are perceptible only by intellect, the number seven is proved to be the only thing free from motion and accident; but among things perceptible by the external senses, it dis- plays a great and comprehensive power, contributing to the improvement of all terrestrial things and affecting even the periodical changes of the moon. And in what manner it does this, we must consider. The num- ber seven when compounded of numbers beginning with the unit, makes eight-and-twenty, a perfect number, and one equalized in its parts. Numerology has unquestionably stimulated investigations in number theory and bequeathed to us some most difficult problems. Let us mention the perfect numbers, which are equal to the sum of their aliquot parts (divisors). The discovery of a pair of amicable numbers symbolizing friendship, like 220 and 284, one the sum of the parts of the other, would not be possible without intimate study of divisibility properties of numbers. 28 NUMBER THEORY AND ITS HISTORY A subject closely related to numerology is gematria (gematry), a name perhaps obtained as a corruption of the word geometry. By assigning number values to the letters in the alphabet in some order, each name and object received a number value. This letter weighting or gematry served to predict relations between persons or future events. Together with astrology it was one of the most popular ancient branches of superstitious learning, and both have persisted to our present days. The origin of gematry was directly connected with the form of the Hebrew and Greek numeral systems. Such alphabetic systems automatically assigned a number to each name and person. The names of the Bible have been a favorite field for gematry. Most famous is the Number of the Beast, given in the Revelation of St. John (13:18): "Here is wisdom. Let him that hath understanding count the number of the beast; for it is the number of a man and his number is six hundred three score and six." In spite of the innumerable researches on this question through the centuries it seems impossible to arrive at any definite solution. Clearly many names will have the same number. In the violent theological feuds of the Reformation it was a vicious stroke to write the opponent's name in such a way that his number became the fatal 666 of the beast. Let us mention also another number replacement that occurs in early theological writings. They often conclude with the number 99, in Greek Q& , and this is a gematry substitute for Amen = aurjv = 1 + 40 + 8 + 50 = 99 as one easily verifies by the list of Greek numerals. 2-2. Multiples and divisors. Number theory, as we have already stated, is primarily concerned with the properties of the natural numbers. However, it is convenient for most purposes to enlarge the system under consideration and investigate the whole set of integers 0, ±1, ±2, ± • • • (2-1) The two numbers ±a are sometimes said to be associated. They are characterized by the fact that they have the same absolute value \a\. PROPERTIES OF NUMBERS. DIVISION 2{\ Now let o be an arbitrary integer. The multiples of o are all numbers 0, ±o, ±2a, =fc • • • (2-2) z.e., all numbers of the form ka where k is integral. One sees that if ka and /ia are two multiples of a, then their sum, difference, and product ka±ha = (k ± A)a, ka • ha = kah • a are also multiples of a. A simple example is the multiples 2n of 2, that is, the even numbers. When a relation c = ab (2-3) holds between the integers a, b, and c ^ 0, one says that a is a divisor or factor of c and that c is divisible by a. We also call (2-3) a decomposition or factorization of c. Clearly b is also a divisor of c and uniquely determined by a. This leads to an observation that is useful in certain problems, namely, that the divisors of a number occur in pairs (a, b). The divisors in such a pair can only be equal (a, a) when c = a 2 is a square number. From (2-3) one obtains a new factorization c= (-a)(-6) where the divisors are associated with a and 6. Each number has the obvious decomposition c =l. c= (-1)(- C ) and ±1 together with ±c are called trivial divisors. Other remarks about divisors are the following: If c x and c 2 are two numbers such that C\ divides c 2 and conversely, then the two numbers are associated ci = ±c 2 . If c\ = ab\ and c 2 = ab 2 are two numbers divisible by a, then their sum and difference are divisible by a. ci ± c 2 = a(&i ± b 2 ) When c = ab is divisible by a, and d = cb\ is divisible by c, then d = abbi is divisible by a. 30 NUMBER THEORY AND ITS HISTORY In most questions regarding divisors we shall assume tacitly that the number c is positive and that one only considers decompositions (2-3) with positive divisors a and b. Clearly all other factori- zations can be written down as soon as the positive factorizations of positive integers have been obtained. In certain problems one is interested only in the proper divisors, consisting of all positive divisors including 1 that are actually less than c; that is, the number c is excluded. This is the point of view in the classical Greek problems. In a decomposition (2-3) the factors a and b cannot both be greater than Vc. One can suppose, therefore, that in a pair of divisors (a, b) one has a ^ Vc and b ^ Vc. This limits the possible numbers that one has to try out in determining the factorizations of a number to divisors that do not exceed Vc. For instance, when c = 60, one has Vc < 8, and one finds the six pairs of divisors 1, 60 3, 20 5, 12 2, 30 4, 15 6, 10 Problems. 1. Find the divisors of the numbers 96 and 220. 2. Prove that a number is a square only when the number of (positive) divisors is odd. 2-3. Division and remainders. Let M be an arbitrary integer. Every other integer a will either be a multiple of b or fall between two consecutive multiples q • 6 and (q + 1)6 of 6. Thus one can write a = qb + r (2-4) where r is one of the numbers 0, 1, 2, ...,|6| - 1 (2-5) In (2-4) r is called the least positive remainder or simply the remainder of a by division with b, while q is the incomplete quotient or simply the quotient. As an example, let us divide 321 by 74 321 - 4 • 74 + 25 PROPERTIES OF NUMBERS. DIVISION 31 Similarly, if 46 is divided by -17, 46= (-2)(-17) + 12 It should be noted that when a and b in (2-4) are given, q and r are uniquely determined so that each integer a can be written in one way in the form qb + r, where r is one of the b numbers (2-5). For instance all numbers are even or odd, i.e., belong to one of the two forms 2q or 2q + 1. When these numbers are squared, one finds respectively V, 4 9 2 + Aq + 1 so that we have: Theorem 2-1. The square of a number is either divisible by 4 or leaves the remainder 1 when divided by 4. One can write the division (2-4) in the ordinary fractional form a r where r/b is zero or a positive fraction less than 1 and q is the greatest integer that is less than or equal to a/b. Such quotients occur so often in number theory that it is convenient to introduce a special notation for them, ~a~ called the greatest integer contained in a/b. Examples. This notation may be extended to arbitrary real numbers. If for a real number <* = q + P, 0^p<l then we write q = [a] for the integer q. Examples. W = 3, [e] = 2, [^J = 4 32 NUMBER THEORY AND ITS HISTORY Sometimes there is an advantage in performing the division in a slightly different manner from (2-4) : We select a multiple kb as near as possible to a on the number axis and obtain a = kb + s (2-6) where s now is a number between - 6/2 and 6/2. Such a represen- tation as (2-6) we call a division with the least absolute remainder. Again k and s in (2-6) are uniquely determined except when 6 is even and the remainder is s = ±6/2, when one can write the division in two ways a = kb + ^ = (fc + 1)6 - - If it is desirable always to have a unique remainder one can agree to use s = 6/2 in this case. Example. As examples of division with smallest absolute remainder, let us divide 35 by 9 and 46 by -17 35 = 4-9-1, 46 = (-3)(-17) -5 It is often convenient to apply the smallest absolute remainder in representing numbers. For instance, every number is representa- ble in one of the three forms 3/e, 3/e ± 1 or one of the five forms 5k, 5fc ± 1, 5k ± 2 or in the four forms 4k, 4fc + 2, 4k ±1 In the last classification the odd numbers must belong to the forms m = 4fc ± 1. As a consequence m 2 = 16k 2 ± 8/c + 1 = 8k(2k ± 1) + 1 so that we can say: PROPERTIES OF NUMBERS. DIVISION 33 Theorem 2-2. The square of an odd number is of the form 8g + 1. Examples. 5 2 = 3 • 8 + 1, 7 2 = 6 • 8 + 1 Some similar results are given among the problems. Any number can be written in the form n = 10a + b, ^ b ^ 9 where b is the last digit in the decadic representation of the number. By squaring one obtains n 2 = 100a 2 + 20a6 + b 2 so that n 2 has the same last digit as b 2 . But when one considers the squares of the numbers from to 9, one finds that they end in one of the six digits 0, 1, 4, 5, 6, 9, so that one can say: Theorem 2-3. The last digit in the square of a number must be one of the numbers 0, 1, 4, 5, 6, 9. For certain problems in number theory, for instance, with some factorization methods, it is of importance to be able to decide quickly whether a number can be a perfect square. By applying the same method as above to the last two digits of a number and looking up the squares of the numbers from to 99, one finds that for a square the last two digits are limited to the following 22 possibilities: Table of the last two digits in a square number 00 21 41 64 89 01 24 44 69 96 04 25 49 76 09 29 56 81 16 36 61 84 Problems. 1. Divide the following pairs of numbers with respect to both least positive and least absolute remainders: (a) 125 and 23 (b) 87 and 13 (c) -111 and -17 (d) 81 and 18 34 NUMBER THEORY AND ITS HISTORY 2. Prove that the square of a number not divisible by 2 or 3 is of the form I2n + 1. 3. Prove that the fourth power of a number not divisible by 5 is of the form 5n + 1. 4. Consider an analogue of theorem 2-3 for third and fourth powers. 5. Prove that in the decadic number system the fifth power of any number has the same last digit as the number itself. 6. Show that n(rt 2 — 1) is divisible by 24 when n is an odd number. 2-4. Number systems. As we mentioned previously, a variety of different number systems have been in use. We observed in this connection that when the basic counting group contained b elements, the systematic extension of the counting process would lead naturally to a representation of the natural numbers in the form a = a n • b n + On-i • & rt_1 + • • • + a 2 • b 2 4- a t • 6 + a (2-7) where the numbers a* take the values 0, 1, 2, • • • , 6 — 1. In analogy to our numerals in the decimal system we can indicate the number (2-7) by the abbreviation The question arises immediately how one can find the form of a number in a system with a given base number, or more generally how one can pass from one system to another. In (2-7) clearly the last number a indicating the units is the least positive remainder of a by division with b, a = qi - b + a where Qi = a n • 6 n_1 + • • • + a 2 * b + ai To determine ai one divides qi by b qi = 92 • b + a x where Q2 = a n - b n ~ 2 + \- a 2 When q 2 is divided by b one finds the remainder a 2 , and through the repetition of this procedure all a/s can be determined. PROPERTIES OF NUMBERS. DIVISION 35 Examples. 1. To represent the number 1,749 in a system with the base 7, one performs the divisions 1,749 = 249-7 + 6 249 = 35-7 + 4 35 = 5-7 + so that one finds 1,749 = (5, 0, 4, 6)7 2. Similarly, to represent the number 19,151 to the base 12: 19,151 = 1,595 12 + 11 1,595 = 132-12 + 11 132 = 11-12+0 so that 19,151 = (11, 0, 11, ll)i2 In the preceding method for finding a number expressed to a base b, the digits a , a x , . . . are determined from the lowest upward. One can also proceed in a manner that yields the digits in the reverse order a n , a n _ x , .... For this purpose, one determines the highest power of b such that b n is less than a while the next power b n+l exceeds a. Then from (2-7) it follows that the division of a by b n must have the form a = a n • b n + r n _! where r n _i = a n _i • V*- 1 -\ \- a From the remainder r n _ x one determines a n _ x in the same manner, and so on. This method is facilitated by a table of the various powers of the base number b. Example. Represent 1,832 to the base 7. One calculates 7 2 = 49, 7 3 = 343, 7 4 = 2,401 36 NUMBER THEORY AND ITS HISTORY and from the divisions 1,832 = 343 • 5 + 117 117 = 49 • 2 + 19 19 = 7 • 2 + 5 one concludes 1,832 = (5, 2, 2, 5) 7 From time to time it has been suggested that our venerable decimal system be discarded in favor of some other system. Most often the numbers 6, 8, or 12 are proposed as the new bases. The arguments for such a change are of various kinds. In the case of the bases 6 and 12, it is pointed out that division by 3 becomes simple; in decimals one has the infinite expansion J = 0.333 • • • while with the bases 6 or 12 i = (0, 2) 6 = (0, 4)ia On the other hand, fractions with denominator 5 would become complicated in these systems; for instance, i = (0, 1, 1, • • • )e If one should wish to have simple expansions for all fractions with denominators 2, 3, 4, 5, one would be led to the Babylonian sexa- gesimal system. Large bases will give short representations of numbers, but they have the drawback that the size of the multi- plication tables to be memorized is considerably increased. A 12 X 12 multiplication table instead of the usual 10 X 10 table may be admissible, but a 60 X 60 table is clearly out of the question. Small bases lead to long number representations but very simple multiplication tables. On the whole there is little evidence that a change of bases will materially reduce the time consumed by numerical computations. The reformers usually pass lightly over the resulting complications and the necessity of changing records, tables, and machines. For one thing, in order to avoid a state of utter confusion in the transition period it would PROPERTIES OF NUMBERS. DIVISION 37 be necessary to invent and use a completely new system of ciphers, because otherwise no one would know whether 23 should mean 23 or 19 (if the base were 8) or 27 (if the base 12 had been decided upon). Problems. 1. Write the two numbers 1,947 and 21,648 to the four bases 3, 5, 7, and 23. 2. Write the number of seconds in 24 hours in the sexagesimal system. 3. Write the number of seconds of arc in 360° in the sexagesimal system. 2-5. Binary number systems. Number systems with other bases than 10 have applications in several branches of mathematics; particularly, the use of low base numbers 2 and 3 is helpful in many types of problems. In the triadic or ternary system each number is represented by means of the digits 0, 1, and 2 while in the dyadic or binary system each number appears as a series of marks or 1. As an example, let us expand the number 87 to the base 2. One finds as before 87 = 43 • 2 + 1 43 = 21 • 2 + 1 21 = 10 • 2 + 1 10 = 5-2 + 5 = 2-2 + 1 2 = 1-2 + 1 = 0-2 + 1 Hence 87 = (1, 0, 1, 0, 1, 1, l) a = 2 6 + 2 4 + 2 2 + 2 1 + 2° (2-8) Let us consider the series of numbers 87, 43, 21, 10, 5, 2, 1 (2-9) occurring in the divisions. Each number is half the preceding with the remainder thrown away. One obtains the digits in (2-8), in 38 NUMBER THEORY AND ITS HISTORY reverse order, by writing or 1 for each number in (2-9) depend- ing on whether it is even or odd. This schematic method not only simplifies the determination of the representation in the dyadic system, but leads also to a peculiar multiplication procedure. To illustrate let us multiply 87 by 59. We form two chains of numbers, the first obtained by successively taking half the pre- ceding number as above, the second proceeding by doubling. 87 59 43 118 21 23(3 10 J&2T 5 944 2 OtSSS" 1 3,776 5,133 In the second column one strikes out the numbers corresponding to even numbers in the first, and the sum of the remaining terms gives the desired product. The proof lies in the dyadic represen- tation of 87 87 • 59 = (1 + 2 + 2 2 + 2 4 + 2 6 )59 This method for performing multiplication reduces the opera- tions to addition, together with doubling or duplication, and halv- ing or mediation. In medieval treatises on computation, these two processes of duplication and mediation were considered to be separate arithmetic operations besides the four usual ones. The principle of reducing multiplication to duplication is very old; it was used by the early Egyptians, and it may well have been the first approach to a systematic multiplication procedure. The method given above is sometimes called Russian multiplication because of its use among Russian peasants. Its great advantage to the inexperienced calculator lies in the fact that it makes unnecessary the memorizing of the multiplication table. There are a great number of games and puzzles whose solutions depend on the use of the dyadic number system. One is the fairly PROPERTIES OF NUMBERS. DIVISION 39 well-known Chinese game of Nim, which is discussed at some length in two of the books cited below (Hardy and Wright, and Uspensky and Heaslet). Another puzzle for children consists of a set of cards, each with a certain group of numbers on it. One is asked to think of a number, and to indicate on which cards it can be found. It is then possible immediately to pronounce the number in question. The cards contain the numbers up to a certain limit arranged in such a way that the first card contains all numbers whose lowest digit in the dyadic system is 1, that is, the odd numbers; the second contains all numbers whose second digit is 1, beginning with 2; the third all whose third digit is 1, beginning with 4, and so on. When it is known on which cards a given number occurs, its dyadic expansion is known. The number itself is the sum of the first numbers on the cards where it appears. As a simple example let us take four cards containing all numbers less than 2 4 = 16. One finds that they must have the forms 1 9 2 10 4 12 8 12 3 ii. 3 11 5 13 9 13 5 13 6 14 6 14 10 14 7 15 7 15 7 15 11 15 Problems. 1. Construct such cards for all numbers up to 31. 2. Expand 365 to the bases 2 and 3. 3. Multiply 178 and 147 by Russian multiplication. Bibliography Albert, A. A. : College Algebra, McGraw-Hill Book Company, Inc , New York, 1946. Bell, E. T.: Numerology, The Williams & Wilkins Company, Baltimore, 1933. : The Magic of Numbers, McGraw-Hill Book Company, Inc., New York, 1946. Birkhopf, G., and S. MacLane: A Survey of Modern Algebra, The Macmillan Company, New York, 1941. 40 NUMBER THEORY AND ITS HISTORY Hardy, G. H., and E. M. Wright: An Introduction to the Theory of Numbers, Clarendon Press, Oxford, 1938. Hopper, Vincent F. : Medieval Number Symbolism, Columbia University- Press, New York, 1938. MacDuffee, C. C: An Introduction to Abstract Algebra, John Wiley & Sons, Inc., New York, 1940. Uspensky, J. V., and M. A. Heaslet: Elementary Number Theory, McGraw- Hill Book Company, Inc., New York. 1939. CHAPTER 3 EUCLID'S ALGORISM 3-1. Greatest common divisor. Euclid's algorism. Let a and b be two integers. If a cumber c divides a and b simultaneously, we shall call it a common divisor of a and b. Among the common divisors of two numbers there must exist a greatest one, which we shall call the greatest common divisor (g.c.d.) of a and b. It is usually denoted by the symbol (a, b). Since every number has the divisor 1 it follows that (a, 6) is a positive number. If (a, b) = 1 we say that the two numbers are relatively prime. In this case ±1 are the only common divisors. Examples. When the divisors of the two numbers 24 and 5G are determined one finds that their g.c.d. is 8. The numbers 15 and 22 are relatively prime. We shall now prove: Theorem 3-1. Any common divisor of two numbers divides their greatest common divisor. To establish this theorem we shall introduce a procedure known as Euclid's algorism, one of the basic methods of elementary number theory. It occurs in the seventh book of Euclid's Elements (about 300 b.c); however it is certainly of earlier origin. Let a and b be the two given numbers whose g.c.d. is to be studied. Since there is only question of divisibility, there is no limitation in assuming that a and b are positive and a ^ b. We divide a by o with respect to the least positive remainder a = Qib + r u ^ r x < b Next we divide 6 by r t b = q 2 n + r 2 , ^ r 2 < n 42 42 NUMBER THEORY AND ITS HISTORY and continue this process on r± and r 2 , and so on. Since the remainders r ly r 2 , ... form a decreasing sequence of positive integers, one must finally arrive at a division for which r n+i = a = qib + n b = q 2 n + r 2 n = q$r 2 + r 3 (3-1) fn—2 — Qn r n—1 i r r, Example. Let us perform Euclid's algorism on the two numbers 76,084 and 63,020. 76,084 = 63,020 63,020 = 13,064 13,064 - 10,764 10,764 = 2,300 2,300 = 1,564 1,564 = 736 736 = 92 1 + 13,064 4 + 10,764 1 + 2,300 4 + 1,564 1 + 736 2 + 92 We shall now show that in Euclid's algorism (3-1) the last nonvanishing remainder r n is the g.c.d. of a and b. The first step is to show that r n divides a and b. It follows from the last division in (3-1) that r n divides r n _ 1 . The next to the last division shows that r n divides r n _ 2 since it divides both terms on the right. Similarly from r n— 3 = q n —l r n—2 ~T" 7"n— 1 one concludes that r n divides r n _ 3 , and successively one sees that r n divides all r/s and finally a and b. The second step consists in showing that every divisor c of a and b divides r n \ this clearly implies that r n is the g.c.d. of a and b EUCLID'S ALGORISM 43 and has the property required by theorem 3-1. But from the first division in (3-1 ) one sees that any common divisor c of a and b divides r 1} since r x = a - q x b; from the second, in the same way, c divides r 2 ; and by continuing this process one establishes that all rt's, and hence r n , are divisible by c. Example. From the previous algorism on the two numbers 76,084 and 63,020 it follows that their g.c.d. is 92. Euclid's algorism gives a very simple and efficient method for the determination of the g.c.d. of two numbers. The French mathematician Lame (1795-1870) has shown that the number of divisions in the algorism is at most five times the number of digits in the smaller number. Another observation of importance is that all arguments used above remain valid for any chain of relations (3-1) without any limitations on the numbers n; there- fore, the conclusions are the same, except that r n may possibly be the negative value of the g.c.d. One could, for instance, have used the least absolute remainders in the divisions (3-1). It has been shown by the German mathematician Kronecker (1823- 1891), one of the leading contributors to number theory in the last century, that no Euclid algorism can be shorter than the one obtained by least absolute remainders. (For a more detailed study of the algorism, see the book by Uspensky and Heaslet, cited in the bibliography of Chap. 2.) Example. Let us perform the algorism for 76,084 and 63,020 by least absolute remainders . 76,084 = 63,020 • 1 + 13,064 63,020 = 13,064 ■ 5 - 2,300 13,064 = 2,300 • 6 - 736 2,300 = 736 • 3 + 92 736 = 92-8 44 NUMBER THEORY AND ITS HISTORY Problems. Find Euclid's algorism for least positive and least absolute remainders and determine the g.c.d. for the pairs of numbers: 1. 139 and 49 2. 1,124 and 1,472 3. 17,296 and 18,416 3-2. The division lemma. From the algorism of Euclid one can derive various other properties of the g.c.d. An important consequence is the division lemma: Theorem 3-2. When a product ac is divisible by a number b that is relatively prime to a, the factor c must be divisible by b. Proof: Since a and b are relatively prime, the last remainder r n in the algorism must be 1 so that it has the form a = qib + ri Tn_ 2 = q n r n -i + 1 We multiply each of these equations by c and obtain ac = q\bc + r±c -2C = q n r n -ic + c Since ac is divisible by b according to our assumption, the first relation shows that r x c is divisible by b. From the second relation one finds that r 2 c is divisible by b, and successively one finds that all r^ and finally c are divisible by b, as we set out to show. Theorem 3-2 leads to the further result : Theorem 3-3. When a number is relatively prime to each of several numbers, it is relatively prime to their product. Proof: Let a be relatively prime to b and to c. If a has a com- mon divisor d with 6c, the product is divisible by d. But (d,b) = 1 since d divides a; thus d must divide c, according to theorem 3-2, contrary to the fact that also (d, c) = 1. The extension of theorem 3-3 to several factors is immediate. Another consequence of Euclid's algorism is: EUCLID'S ALGORISM 45 Theorem 3-4. For the greatest common divisor of two products ma and nib, one has the rule (mo, mb) = m(a, b) (3-2) Proof: In Euclid's algorism (3-1) for the numbers a and b let us multiply each equation by m. am = q^bm + r^m rn_ 2 m = q n r n _ 1 m + r n m r n _im = q n+1 r n m Clearly this is the algorism for am and bm so that their g.c.d. is r n m = m(a, b) as the theorem requires. A useful observation is the following: Theorem 3-5. Let d = (a, b) be the greatest common divisor of two numbers a and b so that a = aid, b = bid (3-3) Then the two numbers a± and b t are relatively prime. Proof: It follows from the rule in (3-2) that d = (a, b) = d(ai, bi) or («!, bi) = 1. This result applies in elementary arithmetic in the reduction of fractions. Any fraction a _ ai b~h can be represented in reduced form with numerator and denominator that are relatively prime. 3-3. Least common multiple. A number m is said to be a common multiple of the numbers a and 6 when it is divisible by both of them. The product ab is a common multiple. Since there is only question of divisibility properties, there is no limitation in considering only the positive multiples. Among the common multiples of a and b there is a smallest one, which we shall denote by [a, b] and call the least common multiple (l.c.m.) of a and b. The 46 NUMBER THEORY AND ITS HISTORY l.c.m. and the greatest common divisor have properties that in many ways are quite analogous. Corresponding to theorem 3-1 one has: Theorem 3-6. Any common multiple of a and b is divisible by the least common multiple. Proof: Let m be a common multiple of a and b. We divide m by [a, b] m = q[a, b] + r, f£ r < [a, b] Since m and [a, b] are both divisible by a and b, it follows that the remainder r has the same property. Since [a, b] is the smallest common multiple, this implies that r = and [a, b] divides m. To determine [a, b] we write a and b in the form of (3-3) where d = (a, b). Any multiple of a has the form ha = haid. If this number is to be divisible by b = bid, the factor ha must be divisible by &i. Because a x and b\ are relatively prime, this is possible only when h is divisible by b\ so that h = kb\. Thus any common multiple of a and b has the form m = kb\a = ka\b\d = ka\b = k — d For k = 1 one obtains the l.c.m. so that one has the result: Theorem 3-7. When a and b are two numbers with the greatest common divisor d = (a, b), the least common multiple is ab [a, b] = - (3-4) The formula (3-4) can be written symmetrically in regard to the l.c.m. and the g.c.d. [a, b](a, b) = ab Example. Find the l.c.m. of the two numbers 76,084 and 63,020. We have already found their g.c.d. to be 92 so that 76,084 • 63,020 [76,084, 63,020] = — — — = 52,117,540 An immediate consequence of theorem 3-7 is: EUCLID'S ALGORISM 47 Theorem 3-8. The least common multiple of two numbers a and b is equal to their product ab if, and only if, they are relatively prime. Corresponding to theorem 3-4 for the g.c.d., one has the analo- gous formula for the l.c.m. Theorem 3-9. [ma, mb] = m[a, b] (3-5) Proof: According to (3-4) and (3-2) one finds r 7 ., ma • mb a • b [ma, mb] = — = m - — — • = m[a, b] (ma, mb) (a, 6) Problem. Determine the l.c.m. for the pairs of numbers for which the g.c.d. was found in Sec. 3-1. 3-4. Greatest common divisor and least common multiple for several numbers. So far the greatest common divisor and the least common multiple have been denned only for two numbers, but there is no difficulty in extending these concepts. Let us consider first the case of three numbers a, b, and c. A common divisor is any number dividing them all. Among these common divisors there is a greatest common divisor, which shall be denoted by d = (a, b, c) To calculate d, we observe that it is the largest number dividing c and (a, b) simultaneously, so that d = ((a,b), c) (3-6) Example. Let us determine the g.c.d. of the three numbers 76,084, 63,020, and 196. In a previous example we have already found (76,084, 63,020) = 92; conse- quently d = (92, 196) =4. The formula (3-6) reduces the computation of the g.c.d. of Lhree numbers to that of two numbers. Instead of beginning with (a, b) one could have taken (b, c) first, so that d= ((o, 6), c) = (a, (6, c)) (3-7) 48 NUMBER THEORY AND ITS HISTORY This rule is called the associative law for the g.c.d. As in theorem 3-1, one sees that every common divisor of a, b, and c divides (a, b, c). From theorem 3-4 one concludes by means of (3-6) that {ma, mb, mc) = m(a, b, c) (3-8) Corresponding to theorem 3-5, it follows that if one writes a = aid, b = bid, c = cid then («i, h, a) = 1 The g.c.d. d n — {p>\, a2, • • ' , a n ) of an arbitrary set of numbers is defined analogously. Since d n is the g.c.d. of a n and the numbers a\, • • • , a n _i, one concludes that d n = («n— 1, a n ), dn—i — {fli, ' ' • , ttn_i) This leads to a stepwise calculation d 2 = (oi, a 2 ), d 3 = (d 2 , a 3 ), • • • All the rules just mentioned for the g.c.d. of three numbers hold in the general case. Let us mention briefly the corresponding concepts for the l.c.m. A common multiple of three numbers a, b, and c is a number divisible by all of them. Among these multiples there is a least common multiple m = [a, b, c\ Since the l.c.m. must be divisible by [a, b] and also by c, one concludes that m = [[a, b], c] Example. To find the l.c.m. of the three numbers 24, 18, and 52, one calculates [24, 18] = 72 and m = [72, 52] = 936. The l.c.m. divides all other multiples. It obeys the associative law, [[a, b],c] = [a, [b, c]] FA JC LID'S ALGORISM 49 and from theorem 3-9 one derives the rule [ma, mb, mc] = m[a, b, c] It is not difficult to see that when one writes m = a' a = b'b = cc one must have (a', &', c') = 1 To define and calculate the l.c.m. m n = [a lt a 2 , • • • , a n ] of a set of numbers, one can proceed stepwise as for the g.c.d. w 2 = [ai, a 2 ], m 3 = [m 2 , a 3 ], ■ • • All properties mentioned for three numbers readily extend to this general case. It may be recalled finally that the determination of the l.c.m. occurs naturally in elementary arithmetic in bringing fractions to their least common denominator to perform addition and sub- traction. Problems. 1. Find the g.c.d. and l.c.m. of the numbers (a) 63, 24, 99 (6) 16, 24, 62, 120 2. Find the l.c.m. of the integers from 1 to 10. CHAPTER 4 PRIME NUMBERS 4-1. Prime numbers and the prime factorization theorem. An integer p > 1 is called a prime number or simply a prime when its only divisors are the trivial ones, ±1 and ±p. The primes below 100 are 2 13 31 53 73 3 17 37 59 79 5 19 41 61 83 7 23 43 67 89 11 29 47 71 97 The number 2 is the only even prime. A number m > 1 that is not a prime is called composite. The lowest composite numbers are 10 16 12 18 14 20 15 9 Analogously one introduces the negative prime numbers —2, —3, — 5, ... , and the negative composite numbers — 4, — 6, ... . In the following sections we shall, as usual, consider only the positive factors in our study of the divisibility of numbers. In regard to divisibility the primes have simple properties. We mention first: Lemma 4-1. A prime p is either relatively prime to a number n or divides it. Proof: This may be concluded from the fact that the greatest common divisor of p and n is either 1 or p. 50 PRIME NUMBERS 5 Lemma 4-2. A product is divisible by a prime p only when p divides one of the factors. Proof: When ab is divisible by p and a is not divisible by this prime, p is relatively prime to a and according to the division lemma must divide 6. The same argument can be extended to a product of several factors. Lemma 4-3. A product q t . . . q r of prime factors q { is divisible by a prime p only when p is equal to one of the g/s. Proof: We have just seen in lemma 4-2 that p must divide some prime q i} and since p > 1 one must have p = q { . Lemma 4-4. Every number n > 1 is divisible by some prime. Proof: When n is a prime, this is evident. When n is composite, it can be factored n = ab where a > 1. The smallest possible one of these divisors a must be a prime. We are now ready to prove the main theorem about factori- zations. Theorem 4-1. Every composite number can be factored uniquely into prime factors. Proof: The first step is to show that every composite number n is the product of prime factors. According to lemma 4-4 there exists a prime p 1 such that n = p x ni. If m is composite, one can draw out a further prime factor m - p 2 n 2 , and this process can be continued with the decreasing numbers m, n 2 , ... until some n k becomes a prime. After the existence of a prime factorization thus has been established, the second step consists in proving that it can only be done in one way. Let us suppose that there exist two different prime factorizations n = p x p 2 -"p k = qiq 2 " -qi (4-1) Since each p t divides the product of the q'&, it follows from lemma 4-3 that pi is equal to some q h and conversely that each q is equal to some p. This shows that both sides of (4-1) contain the same primes. The only difference might be that a prime p could occur a greater number of times on one side than on the other. However, by canceling p a sufficient number of times one would 52 NUMBER THEORY AND ITS HISTORY obtain an equation with p on one side but not on the other, and this contradicts lemma 4-3. The idea of the prime-factorization theorem, as well as the lemmas used in proving it, can be found in Euclid's Elements in Books VII and IX. 4-2. Determination of prime factors. The actual determination of the factorization of a number into prime factors is a problem of great importance in number theory. Unfortunately, for large numbers it often involves overwhelming computations. The procedure nearest at hand consists in trying out all the lowest primes as possible divisors of the given number n. When a prime factor p has been found, one can write n = pm and determine the factorization of the smaller number m. The work is limited by the previous remark that if a number is composite it must have a factor not exceeding Vn, so that only primes p ^ \/n need be divided into n. Another useful observation is that when the smallest prime factor p of n is found to be greater than Vn, the other factor m in n = pm must be a prime. Thus if m = ab were composite, both a and b would exceed 'vn, and one would obtain the contradiction n = pab > yfn \^n 'v / n = n Example. 1. Find the prime factorization of n = 893. Since Vn < 30 only the primes below 30 need be examined. One finds 893 = 19 • 47. 2. Find the prime factorization of the number n = 999,999. One finds successively n = 3 2 • 111,111 = 3 3 • 37,037 = 3 3 • 7 • 5,291 = 3 3 • 7 • 11 • 481 = 3 3 • 7 • 11 • 13 • 37 3. Find the prime factorization of n = 377,161. There are no obvious factors, and since V n < 614 a considerable number of primes may have to be divided into n. One finds that the smallest prime factor is p = 137 and n = 137 • 2,753. Here the second factor is a prime since \n < 73. This method of trial and error is quite satisfactory for relatively small numbers, perhaps not exceeding four digits; for larger PRIME NUMBERS 53 numbers the work involved is prohibitive, as one soon realizes A great number of methods and devices have been invented to facilitate the determination of a factor. There exist criteria that under special circumstances make it possible to decide rather easily whether a number is a prime or not. Some of these will be mentioned later on. Problems. 1. Find the prime factorization of the numbers: (a) 365, (b) 2 468 (c) 262,144. ' ' ' 2. Find the prime factorization of the two numbers: (a) 99,999, (6)100,001 3. Mersenne determined the factorization of the number 51,001 180160 Find the prime factors of this number. ' 4-3. Factor tables. The simplest way to obtain the factori- zation of a number that is not too large is through the use of a factor table. There exist various types of these tables. The most detailed ones contain the complete factorization of every number up to some limit, but such tables are unwieldy and can give space only for relatively few numbers. To increase the capacity, most factor tables indicate only the least prime dividing each entry. Since it is quite simple to determine whether a number is divisible by the lowest primes 2, 3, 5, and 7, the numbers divisible bv them are often excluded from the tables. One of the first fair-sized factor tables was published by Rahn or Rohnius (Zurich, 1659) in an appendix to a book on algebra; the table contained the numbers up to 24,000 excluding those divisible by 2 and 5. In a translation of this work by Brancker (London, 1668) the table was extended to 100,000 by John Pell (1610-1685),' an English mathematician particularly interested in number theory. For a considerable period these tables were the only ones available and they were reprinted several times in other works. The great interest in number theory in the eighteenth century created a demand for factor tables to higher limits. The strong appeals from the German scientist J. H. Lambert (1728-1777) made him a center of correspondence regarding factor tables, and several calculations were initiated. Only one of these tables was 54 NUMBER THEORY AND ITS HISTORY published, and even this one had an inglorious fate. It was com- puted by Felkel, a schoolmaster in Vienna. The first volume, which appeared in 1776 and extended to 408,000, was planned to be a part of a more ambitious program reaching several millions, most of it ready in manuscript. The tables were published at the expense of the Austrian imperial treasury, but since there was a disappointing number of subscribers, the treasury confiscated the whole edition except a couple of copies, and the paper was used in cartridges in a war against the Turks. In the nineteenth century several large factor tables were com- puted by Chernac, Burckhardt, Crelle, Glaisher, and the German lightning calculator, Dase. By their combined efforts all numbers up to 10,000,000 were covered, published in individual volumes for each million. The most remarkable effort in this field was, however, the table calculated by J. P. Kulik (1773-1863), a professor of mathematics at the University of Prague. It repre- sents the results of a twenty-year hobby and gives the factorization of the numbers up to 100,000,000. The manuscript was deposited in the library of the Vienna Academy and has not been published. The best factor table now available is the one-volume table extending to 10,000,000 prepared by D. N. Lehmer. There exist, furthermore, various special tables and punch-card devices due to D. N. Lehmer and D. H. Lehmer that greatly facilitate the deter- mination of factors of numbers beyond the reach of tables. 4-4. Fermat's factorization method. We shall present a couple of simple methods that are sometimes very helpful in finding the factorization of a given number. The first method is due to the French mathematician and lawyer Pierre de Fermat (1601-1665), whose name we shall encounter repeatedly in the following. Fermat must be awarded the honor of being the founding father of number theory as a systematic science. His life was quiet and uneventful and entirely centered around the town of Toulouse, where he first studied jurisprudence, practiced law, and later became prominent as councilor of the local parliament. His leisure time was devoted to scholarly pursuits and to a voluminous correspondence with contemporary mathematicians, many of PRIME NUMBERS 55 whom, like himself, were gentlemen-scholars, the ferment of intellectual life in the seventeenth and eighteenth centuries. Fermat possessed a broad knowledge of the classics, enjoyed literary studies, and wrote verse, but mathematics was his real love. He published practically nothing personally, so that his works have been gleaned from notes that were preserved after his death by his family, and from letters and treatises that he sent to his correspondents. In spite of his modesty, Fermat gained an outstanding reputation for his mathematical achievements. He made considerable contributions to the foundation of the theory of probability in his correspondence with Pascal and introduced coordinates independent of Descartes. The French, when too exasperated over the eternal priority squabble between the followers of Newton and Leibniz, often interject the name of Fermat as a cofounder of the calculus. There is considerable justification for this point of view. Fermat did not reduce his procedures to rule-of-thumb methods, but he did perform a great number of differentiations by tangent determinations and inte- grations by computations of numerous areas, and he actually gave methods for finding maxima and minima corresponding to those at present used in the differential calculus. In spite of all these achievements, Fermat's real passion in mathematics was undoubtedly number theory. He returned to such problems in almost all his missives; he delighted to propose new and difficult problems, and to give solutions in large figures that require elaborate computations; and most important of all, he announced new principles and methods that have inspired all work in number theory after him. Fermat's factorization method, which is the point interesting us particularly for the moment, is found in an undated letter of about 1643, probably addressed to Mersenne (1588-1648). Mersenne was a Franciscan friar and spent most of his lifetime in cloisters in Paris. He was an aggressive theologian and phi- losopher, a schoolmate and close friend of Descartes. He wrote some mathematical works, but a greater part of his importance in the history of mathematics rests on the fact that he was a 56 NUMBER THEORY AND ITS HISTORY favorite intermediary in the correspondence between the most prominent mathematicians of the times. Fermat's method is based upon the following facts. If a number n can be written as the difference between two square numbers, one has the obvious factorization n = x 2 - y 2 = (x - y)(x + y) (4-2) On the other hand when n = ab, b ^ a is composite, one can obtain a representation (4-2) of n as the difference of two squares by putting x — y = a, x + y = b so that b + a b - a x = -~y~ ' V = ~y~ ( 4_3 ) Since we deal with the question of factoring n, we can assume that n is odd; hence a and b are odd and the values of x and y are integral. Corresponding to each factorization of n there exists, therefore, a representation (4-2). To determine the possible x and y in (4-2), we write x 2 = n + y 2 Since x 2 ^ n one has x ^ Vn. The procedure consists in sub- stituting successively for x the values above Vn and examining whether the corresponding A(x) = x 2 — n is a square y 2 . Let us illustrate by a simple example. Example. The number n = 13,837 is to be factored. One sees that Vn lies between 117 and 118. In the first step we obtain A (118) = 118 2 - 13,837 = 87 PRIME NUMBERS 57 which is not a square. In the next step one has A (119) = 119 2 - 13,837 = 324 = 18 2 so that we have found the factorization 13,837 = (119 - 18) (119 + 18) = 101 • 137 This example is too simple to illustrate the short cuts that serve to facilitate the work with larger numbers. One important observation is that one need not calculate each A(x) separately Since (x + l) 2 - n = x 2 - n + 2x + 1 one has A (a: + 1) = A(x) + 2x + 1 and by applying this rule repeatedly one finds &(x + 2) = A(x + 1) +2z + 3 A(x + 3) = A(x + 2) + 2x + 5 This makes it possible to compute the successive A(x)'s by simple additions. Example. We shall take the formidable number n = 2,027,651,281, on which Fermat applied his method. The first integer above Vn is 45,030 and the calcula- tions proceed as follows: X = 45,030 x 2 — n = 49,619 31 2x + 1 = 90,061 139,680 90,063 32 229,743 90,085 33 319,808 90,067 34 409,875 90,069 45,035 499,944 58 NUMBER THEORY AND ITS HISTORY 45,035 499,944 90,071 36 590,015 90,073 37 680,088 90,075 38 770,163 90,077 39 860,240 90,079 45,040 950,319 90,081 x = 45,041 1,040,400 = 1,020 2 = y 2 This shows that we have the factorization n = (45,041 + 1,020) (45,041 - 1,020) = 46,061 • 44,021 where each factor can be shown to be a prime. In this chain of computations, each of the various numbers 49,619, 139,680, . . . should be looked up in a table of squares to determine whether it is actually a perfect square. However, in most cases this step may be eliminated since the last two digits will already show that the number is not a square. The small table of 22 entries that we computed on page 33 giving the possible two last digits of a square number is most convenient for this purpose. Of all the numbers in the preceding chain it is only necessary to look up the numbers 499,944 and 1,040,400, since 44 and 00 may be the last two digits in a square. Fermat's method is particularly helpful when the number n has two factors whose difference 2y = b — a is relatively small, because a suitable y will then quickly appear. In the choice of the example discussed above it is clear that Fermat had this in mind. By means of certain other improvements that can be introduced in the procedure, it becomes one of the most effective factorization methods available. Problem. Factor the following numbers by means of Fermat's method: (a) 8,927, (6) 57,479, (c) 14,327,581. PRIME NUMBERS 59 4-5. Euler's factorization method. Frenicle tie Bessy (1605- 1675) was an official at the French mint and was well known for his unusual facility in numerical computations. He was also a mathematician of no mean ability and was in frequent corre- Fig. 4-1. Leonhard Euler (1707-1783). spondcnce with Fermat. In a letter of August 2, 1641, he pro- poses the following problem : Fse the fact that 221 = 10 2 + ll 2 = 5 2 + 14 2 (4-^1) to find the factors of this number. The same idea, that two different representations of a number as a sum of two squares may serve to factor it, was mentioned by Mcrsenne. However, Euler, for whom the method is usually named, seems to have been the first to put it to extensive use. Leonhard Euler (1707-1783) was a remarkable scientist whose contributions have left their imprint on almost all branches of mathematics. His papers were rewarded ten times by prizes of the French Academy. His productivity was immense; it has been estimated that his collected works, which are still in the 60 NUMBER THEORY AND ITS HISTORY process of being published, will fill upward of 100 large volumes. Euler was born in Switzerland, but he was early called to the Academy in St. Petersburg, later to the Academy in Berlin at the request of Frederic II, and back again to St. Petersburg on still more flattering terms. As a young man he lost the sight of one eye and later in life he became totally blind, but even this calamity did not halt his scientific work. One of his best known texts, Complete Introduction to Algebra (1770), which contains much material on elementary number theory, was dictated to a servant, a former tailor, to prepare him to serve as his mathematical secretary. Euler carried on an extensive correspondence with contemporary mathematicians, and the factorization by means of representation of a number as the sum of two squares is mentioned first in a letter of February 16, 1745, to Christian Goldbach (1690-1764). Gold- bach was a German mathematician, onetime teacher of Peter II and secretary for the Academy in St. Petersburg, who left scientific work to embark upon a distinguished career in the Russian civil service. Euler's factorization method applies only to numbers which in some way can be represented as a sum of two squares N = a 2 + b 2 (4-5) as, for instance, 41 = 5 2 + 4 2 , 269 = 10 2 + 13 2 Since we may assume that the number N to be factored is odd, one of the numbers in (4-5), say a, is odd and the other, b, is even. We have observed that the square of an odd number a 2 is of the form 4n + 1, and since b 2 is divisible by 4, the number JV itself must be of the form 4m + 1. We shall assume now that there exists another representation of N as the sum of two squares N = c 2 + d 2 (4-6) u 3, for instance, in the example (4-4) given by Frenicle. The nota- PRIME NUMBERS 61 tion is again such that c is odd and d even. To show that the two representations lead to a factorization of N, we proceed as follows. From (4-5) and (4-6) we have so that or a 2 + b 2 = c 2 + d 2 a 2 -c 2 = d 2 - b 2 (a - c)(a + c) = (d - b)(d + b) (4-7) Let k be the greatest common factor of a — c and d — b so that a - c = kl, d -b = km, (I, m) = 1 (4-8) By our choice of notations a — c and d — b are even, hence k is even. When (4-8) is substituted into (4-7) and k is canceled, one obtains I (a + c) = mid + b) (4-9) Since I and m are relatively prime, a + c must be divisible by m a + c = mn (4-10) When this is applied in (4-9), finally d + b = In (4-11) The two expressions (4-10) and (4-11) also show that n is the g.c.d. of a + c and d + b; thus n is even. The desired factorization of N which results from (4-5) and (4-6) is now N = [© 2 + ©I (m2 + 12) (4 " 12) To prove that this equation is correct, we multiply out the expression on the right-hand side and find that it is equal to {[(km) 2 + (kl) 2 + (nm) 2 + (nl) 2 ] 62 NUMBER THEORY AND ITS HISTORY Here we substitute the values from (4-8), (4-10), and (4-11) so that the new expression becomes J[(d - b) 2 + (a - c) 2 + (a + c) 2 + {d + b) 2 ] = J(2a 2 + 2b 2 + 2c 2 + 2d 2 ) = i(2N + 2N) = N as we required. Example. For the number N = 221 the two representations (4-4) yield a = 11, a — c = 6, k = 2 & = 10, a + c = 16, Z = 3 c=5, d — 6=4, m = 2 <2 = 14, d +b = 24, n = 8 The decomposition (4-12) is therefore 221 = (1 + 4 2 ) (2 2 + 3 2 ) =17-13 Clearly the decomposition (4-12) is never trivial in the sense that any of the factors is equal to 1. To apply Euler's method one has to determine two representations of a number as a sum of two squares. This may be done by means of tables of squares, as in the case of Fermat's method. Often the number is given in such a form that one representation is immediate. To find any representation of a number N as the sum of two squares, one forms the differences N — x 2 for various x's and examines whether they can be squares y 2 . Many cases are immediately excluded by inspection of the last two digits of N — x 2 . As before, one can reduce the calculations to additions by observing that one obtains N — (x — l) 2 from N — x 2 simply by adding 2x — 1. Examples. 1. Let us factor iV = 2,501. Since N = 50 2 + 1 we need only another such representation. One finds for x = 50, 2,501 - x 2 = 1 2x - 1 = 99 2,501 - 49 2 = 100 = 10 2 PRIME NUMBERS 63 Thus one has a = 1, a - c = -48, k = 8 b = 50, a +c = 50, Z = -6 c = 49, d -b = -40, to = -5 d = 10, d + & = 60, n = 10 so that the decomposition (4-12) is 2,501 = ( 4 2 -H 5 2 )(5 2 + 6 2 ) =41-61 2. Euler applied his method to decompose N = 1,000,009 = 1,000 2 + 3 2 He finds a second representation N = 972 2 + 235 2 and this leads to the factorization N = 293 • 3,413 It is possible to show that if a number can be represented as the sum of two squares one can find all factorizations by Euler's method. Euler succeeded also in obtaining a. proof for the follow- ing theorem due to Fermat: Every prime of the form 4n + 1 can be represented as the sum of two squares. From our preceding results we conclude that such a representation can be made in only one way, since otherwise the number would be factorable. The proof of the theorem of Fermat will be given in Chap. 11. Let us illustrate the theorem on the primes of the form 4n + 1 below 100: 5 = 2 2 +l 2 , 13 = 3 2 +2 2 , 17 = 4 2 +1 2 , 29 = 5 2 + 2 2 37 = 6 2 +l 2 , 41=5 2 + 4 2 , 53 = 7 2 + 2 2 , 61 = 6 2 + 5 2 73 = 8 2 +3 2 , 89 = 8 2 +5 2 , 97 = 9 2 + 4 2 Euler's factorization method is capable of wide extensions. It leads to the theory of representations of numbers by means of quadratic forms, i.e., N = ax 2 + bxy + cy 2 64 NUMBER THEORY AND ITS HISTORY Such representations can under certain conditions be used for factoring in the same manner as the special form N = x 2 + y 2 It would carry us too far to discuss the great number of other aids and methods for factoring, some of them very ingenious. We shall make only a final remark about the last digits of factors. If, for instance, N has the last digit 1, one finds by checking all possibilities that the two eventual factors must both end in 1, or both in 9, or one in 3 and the other in 7. When other last digits in N are examined, one finds the following table: Last Digit Last Digit in Number in Factors 1 (1, 1), (9, 9), (3, 7) 3 (1, 3), (7, 9) 7 (1, 7), (3, 9) 9 (1, 9), (3, 3), (7, 7) The remaining digits 0, 2, 4, 5, 6, 8 are of no interest since there is an obvious factor 2 or 5 in N. This method may be extended in various ways, for instance, to several digits or to representations of the number in number systems with a basis different from 10. Problems. 1. Factor the numbers (a) 19,109, (6) 10,001 by Euler's method. 2. Express all primes of the form 4n + 1 between 100 and 200 as the sum of two squares. 4-6. The sieve of Eratosthenes. The factorization theorem states that every number can be represented uniquely as the product of prime factors. Thus the prime numbers, as their name already indicated in the Greek terminology, are the first building stones from which all other numbers may be created multiplicatively. As a consequence considerable efforts have been concentrated on the study of primes. PRIME NUMBERS 65 The first result that we shall mention has been derived in Euclid's Elements (Proposition 20, Book IX). Theorem 4-2. There is an infinitude of primes. Euclid's proof runs as follows: Let a, b, c, . . . , k be any family of prime numbers. Take their product P = ab • • • k and add 1. Then P + 1 is either a prime or not a prime. If it is, we have added another prime to those given. If it is not, it must be divisible by some prime p. But p cannot be identical with any of the given prime numbers a,b, . . .,k because then it would divide P and also P + 1 ; hence it would divide their difference, which is 1, and this is impossible. Therefore a new prime can always be found to any given (finite) set of primes. We may illustrate the construction of primes by Euclid's method by the following examples: 2-3+1 = 7 = prime 2-3-5+1 = 31 = prime 2-3-5. 7 + 1 = 211 = prime 2- 3-5-7- 11 + 1 = 2,311 = prime 2 • 3 • 5 • 7 • 11 - 13 + 1 = 30,031 = 59 • 509 2 • 3 • 5 • 7 • 11 • 13 • 17 + 1 = 510,511 = 19 • 97 • 277 2 • 3 • 5 • 7 • 11 - 13 • 17 • 19 + 1 = 9,699,691 = 347 • 27,953 In Euclid's proof one could just as well have used the number P - 1. When applied to the first primes, this leads to the factori- zations 2-3-1 = 5 = prime 30,029 = prime 2-3-5-1= 29 = prime 510,509 = 61 - 8,369 209 = 11 • 19 9,699,689 = 53 • 197 • 929 2,309 = prime There are many other numbers which could have served in a 66 NUMBER THEORY AND ITS HISTORY similar manner to obtain arbitrarily large prime factors, for instance, n! ± 1, where as usual n! = 1 -2-3- --n is n factorial. The reader may try to factor some of these numbers. Extensive tables of primes have been computed. Clearly every factor table gives information about the primes within its range, but it is desirable also to have separate lists of primes. Generally available and unusually free from errors are the tables of primes up to 10,000,000 prepared by D. N. Lehmer (1867-1938). There exists an ancient method of finding the primes known as the sieve of Eratosthenes. Eratosthenes (276-194 B.C.) was a Greek scholar, chief librarian of the famous library in Alexandria. He is noted for his chronology of ancient history and for his measurement of the meridian between Assuan and Alexandria, which made it possible to estimate the dimensions of the earth with fairly great accuracy. Eratosthenes' sieve method consists in writing down all numbers up to some limit, say 100: 1 2 3 4 5 6 7 8 9 10 1112 13 1415 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51~ 52 53 54 55 56 57 58 59 60 61 6263646566 67 6869 70 7172 73 747576 7778 79 808182 83 84 85 86 87 88 89 90 9T 92 93 94 95 96 97 98 99 100 From this series one first strikes out every second number counting from 2, that is, the numbers 4, 6, 8, ... . In the example above these numbers are marked by a bar. Counting from the first remaining number, 3, every third number, that is, 6, 9, 12, . . . is marked ; some of them will thus have a second bar. The next remaining number is 5, which is a prime since it has not been PRIME NUMBERS 67 struck out as divisible by 2 or 3; every fifth number 10, 15, 20, . . . is eliminated. The first remaining number, 7, is a prime since it is not divisible by 2, 3, or 5, and its multiples 14, 21, . . . are marked. In this manner all primes may be determined suc- cessively. Clearly the method is well adapted to mechanical procedures. Since it is not necessary to write the numbers explicitly, one can use stencils or punch cards. All larger factor and prime tables have been constructed by means of such devices. The following observation is essential in the application of Eratosthenes' sieve. In the preceding example, when all multiples of 7 have been marked in the fourth step, the remaining unmarked numbers will now include all primes below 100, since no remaining number N has any factor less than the next prime 11 > V~N. This fact makes it possible to use the sieve of Eratosthenes to calculate the number of primes up to prescribed limits. It is customary to denote the number of primes not exceeding a number a; by w{x) ; for instance, tt(12) = 5, tt(17) = 7. Let us return to our example again. Here we had four primes below VlM, namely, 2, 3, 5, and 7. Let us perform the canceling in a slightly different manner so that in the first step also the prime 2 is eliminated, in the second step also 3 is canceled, and so on. What is left after the four cancellations of multiples of 2, 3, 5, and 7 will be the number 1 and the primes between 10 and 100, hence altogether t(100) - t(\/100) + 1 numbers. On the other hand in the first step one cancels 100/2 numbers out of 100. In the second step one cancels [100/3], recalling that the bracket denotes the integral part of the quotient. There is, however, some duplication since the [100/(2 • 3)] numbers divisible by both 2 and 3 have been eliminated twice. After the two steps there remain consequently numbers. In the third application of the sieve one eliminates 68 NUMBER THEORY AND ITS HISTORY [100/5] numbers, but there is duplication with respect to those divisible by 2 • 5 and 3 • 5 so that the next further reduction is R-1-KJ-KH 100 2-3-5 where the last term takes care of the fact that those numbers that are divisible by 2 • 3 • 5 have been subtracted twice from [100/5]. Thus we conclude that out of the 100 original numbers there is now left a total of ■ r i00 "| , poo] _ r loo " |_2 • 5 J |_3 • 5 J |_2 • 3 • 5_ Alter the fourth step one verifies similarly that there remains _f_io^ir^oo_~|_r_ioo_"|_r^po_-| , r_ioo_i L2-3-5J L2-3-7J L2 - 5 • 7 J |_3 • 5 -7j + L2 -3 • 5 • 7 J This makes it possible to calculate 7r(100), since ir(10) = 4 so that tt(100) - 3 = 100 - (50 + 33 + 20 + 14) + (16 + 10 + 7 + 6 + 4 + 2) - (3 + 2 + l 4- 0) + = 22 or tt(100) = 25 as one could have counted directly from the table of primes. It is clear that through the preceding considerations we have been led to a general formula regarding the number of primes. PRIME NUMBERS 69 LetN be the given number and p t , p 2 , ■ • . , P, the primes less than VN. Then ,w - . ( viv) + 1 = * - nn _ m m L-PlJ LP2J LPrJ LP1P2J L.P1P3J _pL_-|_... + ... LP1P2P3J It is not difficult to prove this result in general by means of induction. Through the formula one can determine the numoer of primes below N when the primes below VN are known. The method is cumbersome; for instance, to find the number of primes below 10,000 one must consider the primes less than 100. Some simplification is derived from the fact that many of the terms must vanish. However, as shown by Meissel (1870), the formula may be considerably improved, and through various short cuts he succeeded in finding 7T (100,000,000) = 5,761,455 These computations were continued by the Danish mathematician Bertelsen, who applied them for the determination of errors in prime tables. He announced the following result (1893): t(1,000,000,000) = 50,847,478 which represents our most extended knowledge of the number of primes. Problem. Determine the number of primes below 200 by the method given above and check the result by actual count. 4-7. Mersenne and Fermat primes. Considerable effort hag been centered on the factorization of numbers of particular types. Some of them are numbers resulting from mathematical problems 70 NUMBER THEORY AND ITS HISTORY of interest. Others have been selected because it is known for theoretical reasons that the factors must have a special form. Among the numbers that have been examined in great detail one should mention the so-called binomial numbers N = a n ±b n (4-13) where a and b are integers. Certain factors can be obtained immediately from their algebraic expression, since a n - b n = (a - b) {a 71 ' 1 + a n ~ 2 b + h ab n ~ 2 + b 71 ' 1 ) (4-14) as one verifies by performing the right-hand multiplication. By putting —b for b in (4-14), one obtains for odd exponents n a n + b n = (a + 6) {a 71 ' 1 - a n ~ 2 b + ab n ~ 2 + b n ~ l ) (4-15) If one replaces a and b in (4-14) by a m and b m , it follows that a nm -b nm = (a m -b m ) (a (n_1)m +a w(w ~ 2) 6 m H r-6 w(n-1) ) (4-16) This expression may be used to factor a number (4-13) when the exponent is composite. Thus, every number (4-13) has certain algebraic factors that are fairly easily found, and the essential difficulty lies in factoring these further or in establishing that they are primes. Here one is aided by some knowledge of the type of primes that can divide them. Examples. 1. Factor N = 10 9 - 3 9 = 999,980,317 One finds the algebraic factors 10 - 3 = 7 and 10 3 - 3 3 = 973 = 7 • 139 By using a factor table on the remaining factor, one finds the prime decom- position N = 7 • 19 • 139 • 54,091 2. The number N = 10 9 + 3 9 = 1,000,019,683 PRIME NUMBERS 71 has the algebraic factors 10 + 3 = 13 and 10 3 + 3 3 = 1,027 = 13-79 and the final result is N = 13 • 37 • 79 • 26,317 The prime factorization of the numbers M n = 2 n - 1 (4-17) has been the object of intensive studies. Their decomposition is known and tabulated for a large number of exponents n. For small exponents the reader can easily determine the factors; for instance, M 2 = 3 M 6 = 63 = 3 • 3 • 7 M 3 = 7 M 7 = 127 M 4 = 15 = 3 • 5 M 8 = 255 = 3 • 5 • 17 M 5 = 31 As an example of a more imposing factorization, let us give a prime decomposition that the French mathematician Poulet worked on as a pastime during the occupation in the Second World War. 2 135 - 1 = 7 • 31 • 73 • 151 • 271 • 631 • 23,311 • 262,657 • 348,031 • 49,971,617,830,801 The reason for the particular interest in the numbers (4-17) can be found in the fact that they are directly associated with the classical problem of the 'perfect" numbers, which we shall discuss in the next chapter. Every number M n that is a prime gives rise to a perfect number. These primes are known as Mersenne primes. The historical justification for this nomenclature seems rather weak, since several perfect numbers and their corresponding primes have been known since antiquity and occur in almost every medieval numerological speculation. Mersenne did, how- ever, discuss the primes named after him in a couple of places in his work Cogita physico-mathematica (Paris, 1644) and expressed various conjectures in regard to their occurrence. 72 NUMBER THEORY AND ITS HISTORY It is clear that a number of the type (4-17) cannot be a prime when n ** rs is composite, because there would exist an algebraic factorization of M n as in (4-16). Since in this case a — b = 2 — Fig, 4-2. Marin Merseimc (1588-1648). 1 = 1, the factorization (4-14) is trivial. One concludes there- fore that a Mersenne prime lias the form M 9 = 2 P - 1 where the exponent p is itself a prime. As a consequence, these numbers have been investigated for many primes p. For small p one finds relatively many Mersenne primes, but for larger p they seem to become more and more scarce. At present only 12 Mersenne primes are known; the first ones are M 2 = 3 M 13 - 8,191 M 9 m 7 M l7 m 131,071 JSC* — 31 M 19 = 524,287 M 7 = 127 PRIME NUMBERS 73 The last two of these were determined by the early Italian mathe- matician Cataldi (1552-1626) in his Trattato de numeri perfetti by the direct procedure of dividing by all primes less than the square root of the number. Cataldi was an enthusiastic protagonist for mathematical studies. He founded the first mathematical academy in his native town Bologna and distributed his works free in Italian cities to create interest in the subject. The next Mersenne prime M 31 was determined by Euler (1750) ; another, M 61 , by Pervouchine (1883) and Seelhoff (1886) . Powers (1911) found that M 8Q and, later (1914), M 107 are primes. The largest and last of the known Mersenne primes is M 127 = 170,141,183,460,469,231,731,687,303,715,884,105,727 The only reason for writing explicitly this huge number of 39 digits is that it is the largest number that has actually been verified to be a prime. It was found by the French mathematician Lucas in 1876. Lucas (1842-1891) discovered a new and very much simpler method for testing the primality of the Mersenne numbers. They have now been examined by means of Lucas's criterion for the primes up to and including p = 257, and no new Mersenne primes have been found. The examination of the last few re- maining ones up to this limit has just been completed by H. S. Uhler. (See Supplement.) A family of numbers related to the Mersenne numbers are those of the form N n = 2 n + l (4-l 8 ) Fermat initiated the study of their factors and their primality. Now, for a number of the type (4-18) to be a prime, it is clear that the exponent n cannot have any odd factor. If, for example, n = ab where 6 is odd, one would obtain an algebraic factorization as in (4-15) 2 n + 1 = (2 a ) b -f 1 = (2° + 1) (2 a( ^ 1} - 2 a(b ~ 2) + 2 a(6_3) - |-l) 74 NUMBER THEORY AND ITS HISTORY However, a number without odd factors must be a power of 2 so that n = 2 l , and the numbers take the form F t = 2 2 ' + 1 * (4-19) These numbers are known as the Fermat numbers, and for the first values of t they are seen to be primes F = 3, Fi = 5, F 2 = 17, F 3 = 257, F 4 = 65,537 The next Fermat number is already so large that it is difficult to factor, but on the basis of the few facts at hand Fermat made the conjecture that they are all primes. He expresses this conjecture repeatedly, in letters to Frenicle, Pascal, and others. In August, 1640, he states: 'Me n'en ai pas la demonstration exacte, mais j'ai exclu si grande quantite de diviseurs par demonstrations infail- libles, et j'ai de si grandes lumieres, qui etablissent ma pensee que j'aurois peine a me dedire." It was not until 100 years later (1739) that Euler exploded the hypothesis by the simple expedient of showing that the next Fermat number had a factor. Euler showed first theoretically that any factor of a Fermat number must have the form 2 t+1 k + 1 For t = 5 one concludes, therefore, that the prime factors must have the form p = 64A; + 1. From a prime table one finds that the first primes of this kind are 193, 257, 449, 577, and finally 641, which actually turns out to be a factor of F 5 . Through this discovery the Fermat numbers lost much of their attraction and actuality as a research object. However, through one of the peculiar twists of the lines of mathematical investigation, they reappeared with greater importance in an unsuspected and quite surprising connection with a classical problem. In his famous Disquisitiones arithmeticae the German mathematician C. F. Gauss in 1801 among other things took up the ancient problem of finding all regular polygons that can be constructed by means of compass and ruler. We shall return to the Disquisitiones and the problem of the regular polygons later on. It must suffice- PRIME NUMBERS 75 to state here that after the investigations of Gauss, the problem was reduced to the question of the existence of the Fermat primes. As a consequence, they have been the object of numerous studies, both theoretical and computational, and quite a few of the larger Fermat numbers have been successfully factored. Of Fermat's original conjecture there is no trace; no further primes have been found. Students of the question now seem more inclined to the opposite hypothesis that there are no further Fermat primes than the first five already found. A survey of the present state of the factorizations of Fermat and Mersenne numbers can be found in a recent paper by D. H. Lehmer. 1 Problems. 1. Factor the numbers 10 8 ±3 8 2. Factor some of the first of the numbers 2"±1 beyond those given above. 4-8. The distribution of primes. By checking the entries in a prime table one sees soon that aside from minor irregularities the prime numbers gradually become more scarce. The sieve of Eratosthenes shows that this must be the case since in the higher intervals more and more numbers become effaced. For instance, by actual count one finds that each hundred from 1 to 1,000 con- tains respectively the following number of primes: 25, 21, 16, 16, 17, 14, 16, 14, 15, 14 while in the hundreds from 1,000,000 to 1,001,000, the corre- sponding frequencies are 6, 10, 8, 8, 7, 7, 10, 5, 6, 8 and from 10,000,000 to 10,001,000, 2, 6, 6, 6, 5, 4, 7, 10, 9, 6 1 Lehmer, D. H., "On the Factors of 2" ± 1," Bulletin of the American Mathematical Society, Vol. 53, 164-167 (1947). 76 NUMBER THEORY AND ITS HISTORY A special computation by M. Kraitchik shows that for the interval from 10 12 to 10 12 + 1,000 the corresponding figures are 4, 6, 2, 4, 2, 4, 3, 5, 1, 6 Except for the case p — 2 the primes are odd, so any two con- secutive primes must have a distance that is at least equal to 2. Pairs of primes with this shortest distance are called prime twins; for instance, (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (10,006,427, 10,006,429) In spite of the fact that these prime twins become quite rare in the tables, it is still believed that their number is infinite. On the other hand, one can also find consecutive primes whose distance is as large as one may wish; in other words, there exist arbitrarily long sequences of numbers that are all composite. To prove this statement one need only observe that when n! = 1 -2-3 n the n — 1 numbers n\ + 2, n\ + 3, • • • , n\ + n are all composite. These remarks show that there are great irregularities in the occurrence of the primes. Nevertheless, when the large-scale distribution of primes is considered, it appears in many ways quite regular and obeys simple laws. The study of these laws in the distribution of the primes falls in the field of analytic number theory. This particular domain of number theory operates with very advanced methods of the calculus and is considered to be technically one of the most difficult fields of mathematics. Its central problem is the study of the function ir(x), which indicates the number of primes up to a certain number x. It was discovered quite early by means of empirical counts in the prime tables that PRIME NUMBERS 77 the function ir(x) behaves asymptotically like the function #/log x, that is, for large values of x their quotient approaches 1 ir(x) lim oo z/log x - = 1 (4-20) (The logarithm here and in the following is the natural logarithm to the base e.) This does not, of course, mean that the difference t(x) log x becomes small, but only that this difference is small in comparison with t(x). The result that is expressed in the formula (4-20) is commonly known as the prime-number theorem. For the purpose of approaching the prime function t{x), the so-called integral logarithm is better than the function x/log x, although for large values of x the two functions behave asymp- totically alike. The integral logarithm is defined by means of an integral tv ^ r dt «/2 log t The following table indicates the accuracy of the approximation: X 7r(x) Li(a;) 1,000 168 178 10,000 1,229 1,246 100,000 9,592 9,630 1,000,000 78,498 78,628 10,000,000 664,579 664,918 100,000,000 5,761,455 5,762,209 1,000,000,000 50,847,478 50,849,235 Here the values of ir(x) up to 10,000,000 have been obtained by actual count from tables of primes, while the two remaining entries are the values of t(x) calculated by Meissel and Bertelsen, which we have mentioned previously. 78 NUMBER THEORY AND ITS HISTORY Already Euler had begun applying the methods of the calculus to number-theory problems. However, the German mathe- matician G. F. B. Riemann (1826-1866) is generally regarded as the real founder of analytic number theory. His personal life was modest and uneventful until his premature death from tuber- culosis. According to the wish of his father he was originally destined to become a minister, but his shyness and lack of ability as a speaker made him abandon this plan in favor of mathematical scholarship. He was unassuming to a fault, yet at present he is recognized as one of the most penetrating and original mathe- matical minds of the nineteenth century. In analytic number theory, as well as in many other fields of mathematics, his ideas still have a profound influence. His starting point was a function now called Riemann' 's zeta function This function he investigated in great detail and showed that its properties are closely connected with the prime-number distri- bution. He obtained various results and sketched the path of future progress in a number of well-founded conjectures of which all, except one that still remains undecided, have been shown to be correct. On the basis of Riemann's ideas, the prime-number theorem was proved independently in 1896 by the French mathe- matician J. Hadamard (1865- ) and the Belgian C. J. de la Vallee-Poussin (1866- ). Much progress has been made in analytic number theory since this time, but it remains a peculiar fact that the key to some of the most essential problems lies in the so-called Riemann's hypothesis, the last of his conjectures about the zeta function, which has not been demonstrated. It states that the complex zeros of the function all have the real component ^. Let us present another important result regarding the distri- bution of primes. As an example, the sequence of numbers 3, 7, 11, 15, 19, 23, 27, . . . (4-21) PRIME NUMBERS 79 form an arithmetic series, i.e., consecutive terms in the sequence have the same difference; in this case it is equal to 4. The general term in the sequence (4-21) is 4:n—l, n = 1, 2, 3, • • • The question arises whether this sequence contains an infinite number of primes. To see that this is true, one can apply a method that is a simple generalization of Euclid's idea for proving that there is an infinite number of primes. The assumption that there is only a finite number of primes P\ = 3, P2, • ' • , Pk in the sequence (4-21) leads to a contradiction, as we shall see. One could then form the new number N = 4pip 2 • ' • Pk — 1 = 4P - 1 which is not divisible by any p*. But any odd prime is of one of the forms 4n + 1 or 4n — 1, and the product of two numbers of the form An + 1 is again of this form, so at least one of the prime factors p of N is of the form 4n — 1. But this prime cannot be any of the p/s since they do not divide N; hence p is a new prime in the sequence (4-21). The same argument may be used to show that the arithmetic series with the general term 6n — 1, that is, 5, 11, 17, 23, 29, 35, . . . contains an infinite number of primes. In general, an arithmetic series consists of terms an + b, n = 1, 2, • • • (4-22) where a and b are fixed numbers. If a and b have the common divisor d, all numbers in the sequence are divisible by d. But when one assumes that a and b are relatively prime, it can be shown that the sequence contains an infinite number of primes. This result is known as the theorem of Lejeune-Dirichlet (1805- 1859). It is another of the many theorems in number theory that are simple to state and difficult to prove. Dirichlet's method 80 NUMBER THEORY AND ITS HISTORY requires complicated mathematical tools and many results from other fields. It is puzzling that many special cases can be ob- tained very simply, as we illustrated above, yet the search for an elementary proof has so far been unavailing. Dirichlet's theorem states that the expressions (4-22) gives an infinite number of primes when (a, b) = 1. Attempts to show that other functions may have the same property have not suc- ceeded. It has not even been possible to prove that an expression as simple as n 2 + 1 gives an infinite number of prime values. Related to these questions is the search for functions that will take only prime values for n = 1, 2, . . . . We have already mentioned Fermat's unsuccessful conjecture. The other results on this problem are also all in the negative direction; one can show that certain types of functions cannot have the desired property. 1 For instance, let us show that no polynomial with integral coefficients f(x) = a x r + a\X r ~ x + • • • + a r _ix + a r can take only prime values for integral x. Let us assume that for some x = n, the value f(n) = p is a prime. Then for any integral t, the numbers f(n + tp) are divisible by p, since f(n + tp) - f(n) = a [(n + tp) r - n r ] + a x [{n + tp)*- 1 - n*' 1 ] + • • • + a r -i[(n + tp) - n] Also each difference (n + tpY — n { is divisible by p, as one sees by the binomial expansion. Since every number f(n-\-tp) is divisible by p, these numbers are composite unless f(n + tp) = ±p or f(n + tp) = (4-23) 1 W. H. Mills (Bulletin American Mathematical Society, June, 1947) has re- cently shown that there exists some real number A such that [.A 3 "] gives only primes. (The bracket denotes greatest integer as before.) PRIME NUMBERS 81 But a polynomial of degree r cannot take the same value more than r times so that the cases in (4-23) cannot happen for more than 3r values of t, at most, and for all other values /(n + tp) must be composite. Example. When f(x) = x 2 + 2x + 3 one finds /(2) = 11 and /(2 + 1K) = 11(1 +6t + llt 2 ) is composite and divisible by 11 when t ?* 0. In connection with the prime values that polynomials will take, let us mention some peculiar examples of polynomials that take prime values for a long series of consecutive values of the variable. One is the polynomial x 2 — x + 41 which produces a prime for the 41 values of x: 0, 1, 2, . , . , 40. Similarly x 2 - 79x+ 1,601 gives 80 consecutive prime values when x = 0, 1, • • • , 79. There exist other examples of the same nature. Let us conclude this review of facts and problems from the prime-number theory by a few remarks regarding the additive representation of numbers by means of primes. We have already mentioned the extensive correspondence between Euler and Gold- bach regarding mathematical questions, particularly number theory. In some of these letters, dating from about 1742, Gold- bach discusses the following two conjectures: Every even number ^6 is the sum of two odd primes. Every odd number ^9 is the sum of three odd primes. Euler, whose mathematical intuition was acute, states in reply that he also is convinced of the truth, of these propositions, but he is unable to find any proof. 82 NUMBER THEORY AND ITS HISTORY Factor Table 1 3 7 9 11 13 17 19 21 23 27 3 29 31 33 3 37 39 3 41 I 43 47 49 3 3 7 100 3 3 7 11 3 3 7 3 11 3 200 3 7 3 11 3 7 3 13 3 3 3 13 3 300 7 3 3 11 3 17 3 7 3 3 11 7 400 13 11 3 7 3 3 7 3 19 3 3 500 3 3 7 3 11 3 17 23 3 13 3 7 3 3 600 3 3 13 3 7 3 17 3 7 3 11 700 19 7 3 23 3 7 3 3 17 11 3 3 7 800 3 11 3 3 19 3 3 7 3 29 3 7 3 900 17 3 3 11 7 3 13 3 7 3 3 23 13 1,000 7 17 19 3 3 3 13 3 17 3 7 3 1,100 3 3 11 3 3 19 7 3 11 3 17 7 3 31 3 1,200 3 17 3 7 23 3 3 3 3 17 11 29 1,300 7 3 13 3 3 3 11 31 7 13 3 17 3 19 1,400 3 23 3 17 3 13 3 7 3 3 11 3 3 1,500 19 3 11 3 17 37 7 3 3 11 3 20 3 23 7 1,600 7 3 3 3 3 7 23 11 3 31 3 17 1,700 3 13 3 29 3 17 3 11 7 3 3 37 3 3 1,800 3 13 3 7 23 17 3 3 31 3 11 3 7 19 43 1,900 11 23 3 3 19 17 3 41 3 13 7 3 29 3 2,000 3 3 7 3 3 43 7 3 19 3 13 3 23 3 2,100 11 3 7 3 29 13 3 11 3 3 3 Ij 7 2,200 31 47 3 3 7 3 17 3 23 7 3 3 13 2,300 3 7 3 3 7 3 11 23 13 17 3 3 3 3 2,400 7 3 29 3 19 41 3 3 7 11 3 3 7 31 2,500 41 23 13 3 7 3 11 3 7 3 17 43 3 3 2,600 3 19 3 7 3 3 43 37 11 3 3 7 19 3 3 2,700 37 3 3 11 3 7 3 3 7 3 13 41 2,800 7 53 3 29 3 7 3 11 3 19 17 3 3 7 2,900 3 3 41 3 3 23 37 29 3 7 3 17 3 7 3 3,000 3 31 3 23 7 3 3 13 7 3 3 17 11 3,100 7 29 13 3 11 3 3 53 3 31 13 43 3 7 3 47 3,200 3 3 13 3 3 11 7 3 53 3 41 7 3 17 3 3,300 3 3 7 31 3 3 3 47 3 13 17 3,400 19 41 7 3 3 13 11 3 23 3 47 7 19 3 11 3 3,500 3 31 3 11 3 3 7 13 3 3 3 3 3,600 13 3 3 23 7 3 3 19 3 3 11 7 41 3,700 7 11 3 47 3 61 3 3 7 37 3 19 3 23 3,800 3 3 13 37 3 11 3 43 7 3 3 11 23 3 3 3,900 47 3 3 7 3 3 3 31 3 7 11 4,000 19 3 3 3 3 29 37 11 7 3 13 3 4,100 3 11 3 7 3 23 3 13 7 3 3 41 3 11 3 4,200 3 7 3 11 3 41 3 3 19 3 31 7 4,300 11 13 59 31 3 19 3 7 29 3 3 61 7 3 43 3 4,400 3 7 3 11 3 7 3 19 43 3 11 3 23 3 3 4,500 7 3 3 13 3 3 7 23 3 13 3 19 7 4,600 43 17 11 3 7 3 31 3 7 3 11 41 3 3 4,700 3 3 17 7 3 53 3 29 3 3 7 11 3 47 3 4,800 3 11 3 17 61 3 7 3 11 3 7 3 47 29 37 13 4,900 13 7 3 17 3 7 3 13 3 11 3 3 7 100 200 300 400 500 600 700 800 900 1,000 1,100 1,200 1,300 1,400 1,500 1,600 1,700 1,800 1,900 2,000 2,100 2,200 2,300 2,400 2,500 2,600 2,700 2,800 2,900 3,000 3,100 3,200 3,300 3,400 3,500 3,600 3,700 3,800 3,900 4,000 4,100 4,200 4,300 4,400 4,500 4,600 4,700 4,800 4,900 PRIME NUMBERS Factor Table — (Continued) 83 51 59 61 67 37 29 17 3| 7 7 3 ..23 3 13 ..3 31 11 3 .. 11 3 69 71 11 3 11 | 13 3 73 77 79 29 3 131 | 19 3 3 83 87 11 19 7| 3 3 31 17 3 |23 3 7 ' 3 19 3 13 3 23 3 I 7 7 1 3 131 17 . . 3 3 | 17 47 3 13 3 93 | 97 3 3 3 23 [41 3 | 13 3 7 31 7 3 |43 3 37 3 ' 13 11 | 3 3 | 31 7 7 37 3 19 .. 3 I 11 31 | 3 3 11 23 19 3 17 3 ..7 3 13 3 61 47 53 3 41 7 3 43 3 3 11 41 3 3 19 31 23 37 3 3 43 7 13 3 I 7 7 I 3 23 3 3 59 . . 3 . . 29 3 7 7 3 84 NUMBER THEORY AND ITS HISTORY One verifies Goldbach's conjectures immediately for the smallest numbers. For instance, for even numbers, 6=3 + 3 14 = 3 + 11 8=3+5 16 = 3 + 13 10 = 3 + 7 18 = 5 + 13 12 = 5 + 7 20 = 3 + 17 and for odd numbers, 9 = 3 + 3 + 3 17 = 3 + 7+ 7 11 =3 + 3 + 5 19 = 3 + 5+11 13 = 3 + 3 + 7 21 =3 + 5 + 13 15 = 3 + 5 + 7 The smallest integers 1, 2, 3, 5 must obviously be regarded as exceptions. When the numbers become fairly large, there will usually be numerous representations; for instance, 48 = 5 + 43 = 7 + 41 = 11 + 37 = 17 + 31 = 19 + 29 Goldbach's conjectures have been verified numerically up to 100,000 (N. Pipping). One should note also that the first con- jecture implies the second. Take an odd number N and sub- tract the odd prime p < N from it. Then N — p is even, and if the even numbers could be expressed as the sum of two primes, any odd number N would be the sum of three. A problem for which Euler could find no attacking point could be expected to be extremely difficult, and it was not until fairly recently that essential progress was made. The Norwegian mathe- matician V. Brun (1885- ) developed an extension of the sieve method of Eratosthenes that enabled him to show that every suffi- ciently large even number N can be written as a sum N = JVi + N 2 where Ni and N 2 have at most nine prime factors. Later, others improved the result to four prime factors, but it is still a far cry to PRIME NUMBERS 85 Goldbach's conjecture, which requires a single prime factor in each summand. Goldbach's second theorem, which we saw was a weaker result that would follow from the first, is, however, much nearer to its final solution. In 1937 the Russian mathematician I. Vinogradoff succeeded in showing by analytic means that every odd number that is sufficiently large is the sum of three odd primes. How large the numbers have to be, however, he could not decide. Bibliography Cunningham, A. J. C. : Binomial Factorisations Giving Extensive Congruence- Tables and Factorisation-Tables, Vols. 1-7, Francis Hodgson, London, 1923-25. Kraitchik, M.: Theorie des nombres, Vols. I and II, Gauthier-Villars & Cie, Paris, 1922, 1926. Lehmeb, D.N.: "Factor table for the first ten millions containing the smallest factor of every number not divisible by 2, 3, 5 and 7 between the limits and 10,017,000," Carnegie Institution of Washington Publication 105 (1909). : "List of Prime Numbers from 1 to 10,006,721," Carnegie Institution of Washington Publication 165 (1914). CHAPTER 5 THE ALIQUOT PARTS 5-1. The divisors of a number. Several problems relating to the divisors of a number can be solved by means of the main theorem that every integer can be represented uniquely as the product of prime factors. A number N shall be written N = pi> 2 " 2 • • • V r ar (5-1) where the p/s are the various different prime factors and on the multiplicity, i.e., the number of times p { occurs in the prime factorization. For any divisor d of N one has N = ddi (5-2) where d x is the divisor paired with d. When multiplied together, the prime factorizations of d and d\ must give that of N so that d = piV ' • • Vr Sr (5-3) where the exponents 5; do not exceed the corresponding at in (5-1). Since the second factor in (5-2) must contain the remain- ing factors, it becomes dx = pi" 1 - 51 ^" 2- * 2 ' ' • Pr ar ~ Sr In the expression (5-3) for a divisor the exponent 5i can take the «i + 1 values 0, 1, . . . , a\, similarly 8 2 the a 2 + 1 values 0, 1, ... , a 2 , and so on. Since each choice of 5i can be combined with any choice of 8 2 , and so on, one concludes : Theorem 5-1. The number of divisors of a number N in the form (5-1) is v(N) = («i + l)(a 2 + 1) ' ' ' («r + 1) (5-4) THE ALIQUOT PARTS 87 Example. The number 60 = 2 2 • 3 • 5 has f(60) = (2 + 1)(1 + 1)(1 + 1) = 12 divisors. They are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 (5-5) We shall now determine various expressions that may be formed by means of the divisors of a number. We find first the product of the divisors. In (5-2) let d run through all v(N) divisors of N. The corresponding c?i will then also run through these divisors in some order, so that the product of all d'a is the same as the product of all di'a. This we write Ud = Udt where the symbol II, as usual, denotes the product. We form the product of all i>(JV) equations (5-2) and obtain N V(N) = (EfaXlfai) = (lie*) 2 This yields the desired result: Theorem 5-2. The product of all divisors of a number N is Ud = N^ N) Example. The product of all divisors of 60 is Hd = 60 6 = 46,656,000,000 as one may check by multiplying together the divisors (5-5). The result in theorem 5-2 can be expressed in a different manner When xi, x 2 , . . . ,x n (5-6) is a set of n positive numbers, the geometric mean of the numbers is defined to be G = Vx\X2 • ' ' Xn 88 NUMBER THEORY AND ITS HISTORY When applied to the product of the v(N) divisors of N, one sees: Theorem 5-3. The geometric mean of the divisors of a number Wis G(N) - VN The determination of the sum <r(N) of the divisors of a number N is slightly more complicated. We shall first reduce the problem to the case where N is a power of a single prime, a method that is often applicable in similar problems. Let us write the given number iVasa product of two relatively prime factors N = ab Since the prime factors of a and b are different, one concludes that any divisor d of N must have the form d = ajbi (5-7) where a,- is a divisor of a and b { a divisor of 6. We denote the divisors of a and b, respectively, by 1, a h a 2 , . . . , a, 1, b x , b 2 , . . . , b so that their sums are a (a) = 1 + a x + a 2 -\ f- a, <r(6) = 1 + b x + b 2 -\ \- b In (5-7) let us take all divisors of N with the same a { . Their sum is a t -(l + bi + b 2 H h b) = a t -*(b) Next, by taking this sum for all possible a* one obtains as the total sum of all divisors of N l(r (6) + ai(r(6) H 1- aa(b) = a(a)<r(b) Thus we have derived the result that when a and b are relatively prime <r(N) = <r(ab) = a(a)a(b) (5-8) We split a and b further into relatively prime factors and apply the same rule (5-8) again. This may be continued until the factors become the powers of the various primes dividing N. As a con- THE ALIQUOT PARTS 89 sequence we conclude that when N has the prime factorization (5-1) °(N) = c(p^)a(p 2 ^) • . • a(7> r «0 (5-9) For a prime power p a the divisors are 1, P,P 2 ,-.-, P a so that a{p a ) = l + p + p 2 H hp a This is a geometric series in which the quotient of two consecutive terms is p. It may be summed by the usual trick, multiplying the series by p V ' <?(p a ) = p + p 2 H \- p a + p a+1 and subtracting the original series p • o{p a ) - a(p a ) = p« +1 - 1 so that p a+1 — 1 0-(p a ) = — (5-10) p — 1 v ' When this result is applied to each factor in (5-9), we have proved: Theorem 5-4. The sum of divisors of a number N with the prime factorization (5-1) is Each prime power p a in the factorization (5-1) contributes a factor (5-10) to the expression (5-11) for the sum of the divisors. It is useful to observe the two following simple cases, which occur commonly. When there is a single prime factor p, one has When p = 2 a , *(P) = ~ T = V + 1 p - 1 *(2 a ) = 2 _ = 2« +1 - 1 90 NUMBER THEORY AND ITS HISTORY Let us mention also that the average or arithmetic mean A(N) of the divisors is obtained by dividing their sum a(N) by their number v(N) so that wlm (5 " 12) Example. The sum of the divisors of 60 = 2 2 • 3 • 5 is <r(60) = (2 3 - 1)(3 + 1)(5 + 1) = 168 as one can verify by summing the divisors (5-5). Their average is 168 ^(60) =— = 14 Since 14 > a/60 this illustrates the general fact that the arithmetic mean is greater than the geometric mean. The harmonic mean H of a set of numbers (5-6) is denned by i i.(I + I + ... + I) (8 _ 13) H n \Xi X2 Xn/ To determine the harmonic mean H(N) of the divisors of a number N let us first find the sum of their inverse values. According to (5-2) one has for any divisor d 1 _ a\ d~ N where d x is the divisor paired with d. Here, as before, when d runs through all divisors of N, so will d\. By summing all these equations for the various d's, one obtains therefore 1 1 1 a(N) where 21 is the usual summation symbol. According to (5-13), THE ALIQUOT PARTS 91 we divide by the number v(N) of divisors and find by means of (5-12) H(N) v(N)^d v(N)N~ N This gives the result: Theorem 5-5. The product of the harmonic and arithmetic mean of the divisors of a number is equal to the number itself N = A(N) -H(N) Since the arithmetic mean is greater than the geometric mean VN of the divisors, one has the inequality A(N) ^ VN ^ H(N) in accordance with the general theory of means. Example. We have seen that the arithmetic mean of the divisors of 60 is 14. Therefore #(60) = ff = 4f Problems. 1. Find the number of divisors, their sum, and their means for (a) 220 (6) 365, (c) 6! = 1 • 2 • 3 • 4 • 5 • 6. 2. Find the sum of the squares of the divisors of a number. 3. Find the smallest numbers with 2, 3, 4, 5, or 6 divisors. 5-2. Perfect numbers. The perfect numbers are essential elements in all numerological speculations. God created the world in six days, a perfect number. The moon circles the earth in 28 days, again a symbol of perfection in the best of all possible worlds. In numerological terminology, the divisors are the parts of which a number is created or reproduced. A perfect number is a number that is the sum of its divisors, or, in more archaic language, it is the sum of its aliquot parts. In this definition it must be observed that Greek mathematics excluded the number itself as a proper part. Therefore, to obtain the sum (r (N) of the aliquot parts of a number N in the Greek sense, one must diminish the 92 NUMBER THEORY AND ITS HISTORY sum <t(N) of all divisors we found in theorem 5-4 by the improper divisor N so that ffQ (N) = <r(N) - N (5-14) The condition for a perfect number may then be expressed in the formula *o(N) = N (5-15) or equivalently <r(JV) = 2N (5-16) By means of any of these conditions one can check whether a number is perfect. For instance, cr(6) = <r(2 • 3) = (2 + 1)(3 + 1) = 12 and <r(28) = a(2 2 • 7) = (2 3 - 1)(7 + 1) = 56 so that both 6 and 28 are perfect numbers. Only one general type of perfect numbers is known: Theorem 5-6. A number of the form p = 2^" 1 (2 P - 1) (5-17) is perfect when q = 2 P - 1 is a Mersenne prime. This theorem represents the final proposition in the ninth book of Euclid's Elements. The proof consists in computing <r(P) = (2 p - l)(q + 1) = (2 p - 1)2 P = 2P We have already mentioned that there are only 12 known Mersenne primes, which one obtains for p = 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127 From these one computes the 12 known perfect numbers. The first four are P 2 = 2 • (2 2 - 1) = 6 P 3 = 2 2 • (2 3 - 1) = 28 P 5 = 2 4 • (2 5 - 1) = 496 P 7 = 2 6 • (2 7 ~ 1) = 8,128 THE ALIQUOT PARTS 93 In Barlow's Number Theory (London, 1811) the author gives the perfect numbers up to P 31 corresponding to the Mersenne prime M Z1 obtained by Euler, at the time the greatest prime known. This perfect number "is the greatest that will ever be discovered, for, as they are merely curious without being useful it is not likely that any person will attempt to find one beyond it." The great efforts expended since that time in such computations show that it is difficult to underestimate human curiosity. At present it seems possible that further efforts along these lines will be made by means of the tremendous calculators developed during the Second World War, as soon as they are available for more peaceful pursuits. All of these perfect numbers are even; Euler succeeded in proving the following theorem, which is the most general result known for perfect numbers : Theorem 5-7. Every even perfect number is of the type (5-17) discussed by Euclid. To prove this theorem we write the even perfect number P in the form P = 2*- 1 • q (5-18) where q is some odd number. Since the two factors in (5-18) are relatively prime, one finds as in (5-8) a(P) = a(2^) • a(q) = (2*> - 1) • a(q) The condition (5-16) for a perfect number states that one must have cr(P) = (2? - l)a(q) = 2P = 2*> ■ q In this relation let us use the sum <r Q (q) of the proper divisors as defined in (5-14) instead of a(q). One obtains (2* - l)[cr (g) + q] = 7Pq and this may be rewritten q = (2 p - lkofe) (5-19) This condition permits us to draw some strong conclusions. It 94 NUMBER THEORY AND ITS HISTORY implies first that d = cr (q) is a proper divisor of q. On the other hand <r (q) was the sum of all proper divisors of q, including d, so that there cannot be any other proper divisors besides d. But a number q with a single proper divisor d must be a prime and d = 1. From (5-19) one concludes finally that q = 2 P - 1 is a Mersenne prime. Thus the even perfect number (5-18) is of the form (5-17) given by Euclid. Do there exist any odd perfect numbers? This is one of the celebrated unsolved problems in number theory. Extensive numerical computations have failed to divulge any odd perfect number less than 2,000,000. It has been possible to find various conditions that such numbers must satisfy but they are insuffi- cient to prove that odd perfect numbers cannot exist. (See Supplement.) For numbers that are not perfect there are the two possibilities: <r (N) > N, <r (N) < N Numbers of the first kind are called abundant, and those of the second kind are deficient. This distinction is considered important in numerology. For instance, Alcuin (735-804), the adviser and teacher of Charlemagne, observes that the entire human race descends from the 8 souls in Noah's ark. Since 8 is a deficient number, he concludes that this second creation was imperfect in comparison with the first, which was based on the principle of the perfect number 6. The perfect numbers represent the happy medium between abundance and deficiency. The first few abundant numbers are 12, 18, 20, 24, 30, 36, . . . There are only 21 abundant numbers up to 100, as the reader may verify, and they are all even. The first odd abundant number is 945 = 3 3 • 5 • 7 for which <r (945) = 975 THE ALIQUOT PARTS 95 There exists a table of the values of the sum <r(N) of the divisors of the numbers up to 10,000, computed by J. W. L. Glaisher, so that the character of numbers not exceeding this limit is easily de- termined. There are some rules for abundant and deficient numbers: for instance, a prime or a power of a prime is deficient- any divisor of a perfect or deficient number is deficient; any multiple of an abundant or perfect number is abundant. We saw that the perfect numbers were defined by the condition *q(N) = N For certain abundant numbers the sum of the proper divisors may turn out to be a multiple of the number itself. For example <r (120) =2-120 as one easily verifies. A number of this kind is called multiply perfect. When <ro(N) = k-N the integer k may be called the class of the multiply perfect number so that 120 is of class 2 while the perfect numbers are of class 1 ' The problem of finding such multiply perfect numbers appears to have been formulated first in 1631 by Mersenne in a letter to Rene Descartes (1596-1650). Although Descartes's fame rests mainly on his philosophical method and in mathematics on his creation of analytical geometry and the invention of coordinate systems, he was also greatly interested in number theory and made various contributions to it. He must have speculated considerably over the problem proposed by Mersenne, because about seven years later he responded with a list of multiply perfect numbers which he could not have discovered without great effort and ingenuity. In the meanwhile, Fermat had also tackled the problem and discovered a second multiply perfect number, namely, 672 = 2 5 • 3 • 7 for which (T (672) = 2-672 96 NUMBER, THEORY AND ITS HISTORY while Andre Jumeau, prior of Sainte-Croix, found a third 523,776 = 2 9 -3 • 11 ■ 31 also of class 2. Descartes in several letters to Mersenne gave another multiply perfect number of class 2, namely, 1,476,304,896, six others of class 3, and one of class 4. In addition he described Fig. 5-1. Ren6 Descartes (1596-1650). various general rules that permitted him to construct these numbers. The subsequent letters exchanged between Mersenne, Fermat, and Freniele contain several other multiply perfect numbers. More recently many others have been discovered, notably by E. Lucas, D. N. Lehmer, A. Cunningham, R. D. Carraichael, and D. E. Mason. The most complete list to date is due to P. Poulet (1929), and it contains 334 multiply perfect numbers, some of class as high as 7. (See Supplement.) 5-3. Amicable numbers. Another type of numbers that are prominent in the lore of number mysticism is the amicable numbers. They are defined to be pairs of numbers such that each member is THE ALIQUOT PARTS 97 composed of the parts of the other, thus symbolizing mutual harmony, perfect friendship, and love. The existence of amicable numbers seems to have been discovered somewhat later than the perfect numbers, probably in the period of the flowering of the Neo-Platonic mystical school in Greek philosophy. One of the most influential of the Neo-Platonic philosophers, Iamblichus of Chalcis (about a.d. 320), ascribes the knowledge of amicable numbers to the earliest Pythagorean school (about 500 b.c). This mythical tradition has, however, little credit with the his- torians of the mathematical sciences. In Arab mathematical writings the amicable numbers occur repeatedly. They play a role in magic and astrology, in the casting of horoscopes, in sorcery, in the concoction of love potions, and in the making of talismans. As an illustration let us quote from the Historical Prolegomenon of the Arab scholar Ibn Khaldun (1332-1406) : Let us mention that the practice of the art of talismans has also made us recognize the marvelous virtues of amicable (or sympathetic) numbers. These numbers are 220 and 284. One calls them amicable because the aliquot parts of one when added give a sum equal to the other. Persons who occupy themselves with talismans assure that these numbers have a particular influence in establishing union and friendship between two individuals. One prepares a horoscope theme for each individual, the first under the sign of Venus while this planet is in its house or in its exaltation and while it presents in regard to the moon an aspect of love and benevolence. In the second theme the ascendant should be in the seventh sign. On each one of these themes one inscribes one of the numbers just indicated, but giving the strongest number to the person whose friendship one wishes to gain, the beloved person. I don't know if by the strongest number one wishes to designate the greatest one or the one which has the greatest number of aliquot parts. There results a bond so close between the two persons that they cannot be separated. The author of the Ghai'a and other great masters in this art declare that they have seen this confirmed by experience. Through the Arabs the knowledge of amicable numbers spread to Western Europe. They are mentioned in the works of many 98 NUMBER THEORY AND ITS HISTORY prominent mathematical writers around a.d. 1500, for instance Nicolas Chuquet, Etienne de la Roche, known as Villefranche, Michael Stiefel, Cardanus, and Tartaglia. As we have already stated, a pair of numbers is said to be amicable when the sum of the aliquot parts of one is equal to the other, and conversely. In our previous terminology this can be expressed that M and N are amicable when «7 O (A0 = M, * (M) = N (5-20) When one uses the sums of all divisors of the numbers, the con- ditions (5-20) may be restated <r(N) = <r(M) = N + M (5-21) In ancient numerology there appears but a single set of amicable numbers, namely, the pair N = 220 - 2 2 • 5 • 11, M = 284 = 2 2 • 71 Even the discovery of the special relations between these two fairly large numbers is evidence of considerable familiarity with number properties. For this pair one has M + AT = 504 and the formula for the sum of the divisors of a number yields <r(N) = (2 3 - 1)(5 + 1)(11 + 1) = 504 = (2 3 - 1)(71 + 1)> v{M) so that the condition (5-21) is fulfilled. There is no indication of any other pair of amicable numbers having been discovered before the work of Fermat. This is some- what peculiar since Fermat found his new pair through the redis- covery of a rule that actually had been formulated by the Arab mathematician Abu-1-Hasan Thabit ben Korrah as early as the ninth century. This rule we shall reformulate as follows: For the various exponents n, write down in a table the numbers Vn = 3 • 2 n - 1 (5-22) THE ALIQUOT PARTS 99 n 1 2 3 4 5 95 6 7 Vn 5 11 23 47 191 383 As may be seen, each number is obtained by doubling the pre- ceding and adding 1. (5-23) If, for some n, two successive terms Vn _ x and p n are both primes, one examines the number q n = 9 • 2 2 — 1 - 1 (5_ 24 ) If this number is also prime the pair M = 2 n Pn _ lPn , N = 2 n q n (5-25) is amicable. To illustrate the rule we observe that -p x = 5 and p 2 = 11 are primes, and since q 2 = 71 is also prime we obtain the classical pair 220 and 284 from (5-25). To prove the rule of Thabit ben Korrah we compute bv means of (5-22) and (5-24) a{M) = (2 W+1 - lXp^ + l)(p n + 1) = Q • 2 2n ~ 1 (2 n+1 - 1) *(N) = (2 W+1 - \){q n + 1) = 9 . 2 2n-i (2 n+i _ 1} Since also M + N = 2 n • (p n _ l7?n + ffw ) = 9 • 2 2n ~ 1 (2 n+1 - 1) the pair is amicable. The next pair of successive primes in the table (5-23) is p 3 = 23 and p 4 = 47. In this case g 4 = 1,151 is also prime, and we obtain the amicable pair announced by Fermat in 1636 17,296 = 2 4 • 23 • 47, 18,416 = 2 4 • 1,151 Descartes stated in letters to Mersenne in 1638 that he had been led to the same rule and gave the third pair of amicable numbers 9,363,584 = 2 7 • 191 • 383, 9,437,056 = 2 7 • 73,727 corresponding to the primes p 6 = 191 and p 7 = 383 in the series (5-23). 100 NUMBER THEORY AND ITS HISTORY Euler took up the search for amicable numbers in a systematic manner and developed several methods for finding them. In 1747 he gave a list of 30 pairs which he later expanded to more than 60. Some of them are 2 • 5 • 7 • 19 • 107 J2 4 47-89 J2 3 19-41 2 • 5 • 47 • 359 [2 4 53-79 [2 5 199 2 4 • 23 • 479 J2 2 •5-251 J2 3 •17-79 2 4 • 89 • 127 [2 2 • 13 • 107 )2 3 •23-59 A rank amateur may occasionally make a contribution to number theory, as was demonstrated again when the sixteen-year-old Italian boy Nicolo Paganini in 1866 published the very small pair of amicable numbers 1,184 = 2 5 • 37, 1,210 = 2 - 5 • ll 2 which had eluded all previous investigators. They were probably found by trial and error. An extensive list of amicable numbers is due to P. Poulet (1929). A complete survey of the existing knowledge about amicable numbers has recently been published by E. B. Escott. It contains a list of the 390 known amicable pairs together with the names of their discoverers. 5-4. Greatest common divisor and least common multiple. The algorism of Euclid enabled us to find the greatest common divisor of two and more numbers and also their least common multiple. When the prime-factor decompositions of the numbers are known, the process becomes much simpler. Let a and b be two given numbers, and a = pi'V 2 • • • Pr ar , b = Pi^W ' ' • Pr* (5-26) be their prime factorizations. It is convenient to write the two decompositions formally as if the same primes occur in both. This is possible since, for instance, if p\ should not divide b one can take j3i = 0. Since one is interested in what happens in regard to each prime pi, it often simplifies matters to use the product symbol and write instead of (5-26) a = Upi ai , b = lip/* (5-27) THE ALIQUOT PARTS 101 When a number d is to divide both a and b, it cannot have any prime factors different from those occurring in these numbers so mat OTIfi ran wnfo oyj that one can write Vt t (5-28) d = p x h p 2 h Sr For each t the exponent 8 t in (5-28) cannot exceed any of the corresponding «• and ft in (5-26). If, therefore, d is to be the g.c d. of a and b, the exponent fc must be the smaller or minimal write 6 eXp ° nents ai and ^ In mathematical shorthand we «,• = min (a h ft), i = 1, 2, • • • , r Similarly if m = p^p 2 ^ --p* is to be divisible both by a and b, none of the exponents * can be less than ^ or ft. Therefore, if n is the l.c.m. of a and ^ «•■ must be equal to the greater or maximal of the two number, a 4 and ft ; m symbols U(ffL m = max {ai, ft), * = 1, 2, • • , r Let us summarize these remarks: Theorem 5-8. The greatest cummon divisor and the least common multiplum of the two numbers a and 6 with the prime decompositions (5-27) are respectively (a, b) = u P r- «>*. a>, k 6] = IIp . max ( «, *> It is evident that these rules (5-29) can be extended to three or an arbitrary set of numbers. Example. For a = 2 6 • 3 2 • 5, 6 = 2 5 • 3 3 • 7 one has the g.c.d. and l.c.m. (a, 6) = 2 5 • 3 2 , [a, b] = 2 6 • 3 3 ■ 5 • 7 Let us show how some of the properties of the g.c.d and the l.c.m. we derived previously (Chap. 3) follow quite simply also 102 NUMBER THEORY AND ITS HISTORY from the formulas (5-29). If we multiply the two numbers (a, b) and [a, b], the exponent to each p { becomes min (ai, 8%) + max (a,-, &•) But the sum of the smaller and the greater of two numbers is their sum a{ + 6i. On the other hand a* + &• is the exponent of pi in the product ab so that we have (3-4) (a, 6) [a, b] = a& (5-30) Let us next multiply the g.c.d. (a, 6) by a number c with the prime decomposition c = pi 71 p 2 72 • ' • Pr Jr The exponent of pi in the product c • (a, b) is then 7,- + min (a,-, 8i) But this is the same as the number min (7,- + oti, 7i + 8i) which is the exponent of pi in (ca, cb). This shows us that c(a, b) = (ca, cb) (5-31) as we obtained previously in (3-2). Similarly one sees that for the l.c.m. (3-5) c[a, b] = [ca, cb] (5-32) holds, because one has the identity ji + max (ai, 8i) = max (?,- + a { , y { + &■) The laws (5-30), (5-31), and (5-32) were derived here by means of the theorem of the unique factorization of a number into prime factors. It is of interest to note that each of them is the expression of some simple property of the process of forming maximum and minimum of two numbers, namely, min (a, 6) + max (at, 8) = a + B 7 + min (a, 8) = min (7 + a, 7 + 8) 7 + max (a, 8) = max (7 + a, 7 + 8) THE ALIQUOT PARTS 103 A little later on we shall derive some properties of the g.c.d. and the l.c.m. that depend on the same principle, but involve the maximum and minimum of three numbers. Let us discuss the two operations of forming the g.c.d. and the l.c.m. from a somewhat different point of view. Each of them d = (a, b), m = [a, b] associates new elements d and m with the given ones a and b, much in the way of ordinary addition and multiplication. These oper- ations satisfy some very simple laws: 1. Idempotent law: (a, a) = a, [a, a] = a 2. Commutative law: (a, b) = (b, a), [ a , b] = [b, a] 3. Associative law: ((a, b), c) = (a, {b, c)), \[ a , b], c] = [a, [6, c]] 4. Absorption law: [a, (a, b)] = a, (a, [ a , 6]) = a Let us make a few comments on the four properties of the operations. First, it should be noticed that the two operations are dual, i.e., the conditions remain the same when the g.c.d. and the l.c.m. are exchanged everywhere. The idempotent condition states only that the g.c.d. and the l.c.m. of a number a with itself is a. The commutative law and the associative law are exactly the same as for addition and multiplication a + b = b + a, ab = ba a + (6 + c) = (a + b) + c, a(bc) = (ab)c Since (a, b) is a divisor of a, the l.c.m. of a and (a, b) must be a and the second part of the absorption law is equally trivial. 104 NUMBER THEORY AND ITS HISTORY Here also, the four laws can be expressed as properties of the operation of forming maximum and minimum of numbers. Let p be some prime that divides a, b, and c to the powers p a , p®, and p y , respectively. Then we leave it to the reader to verify that the four laws are consequences of 2. 3. min (a, a) = a, max (a, a) = a min (a, 0) = min (p, a), max (a, 0) = max (0, a) min {min (a, /3), 7} = min {a, min (0, 7)} max {max (a, j3), 7} = max {a, max ((3, 7)} 4. max {a, min (a, /3)} = a, min {a, max (a, 0)} = a One reason for going into these simple rules for the g.c.d. and the l.c.m. in some detail is that mathematicians quite recently have come to realize that in many important mathematical systems there exist operations with analogous properties and, furthermore, that the mathematical theories of these systems are essentially dependent on these laws of combination. It is far beyond the scope of this book to discuss these theories; it must suffice to say that they occur in the extension of number theory to other systems than the ordinary integers; they appear in many theories of algebra, in function theory and geometry, and even in logic. In all cases, there are two operations corresponding in our special case to g.c.d. and l.c.m. A special notation has been introduced for such operations, namely, d = a n b, m = a u b while various names are in use, for instance, meet and join or union THE ALIQUOT PARTS 105 and cross-cut. The two operations satisfy the same dual set of axioms as those mentioned previously : 1. a n a = a, a v a = a 2. a nb = b n a, a v b = b u a 3. a n (6 n c) = (a n b) n c, a u (6 u c) = (a u 6) u c 4. a u (a n b) = a, a n (a u 6) = a Systems that satisfy these axioms have been called lattices or sometimes structures. Besides the g.c.d. and the l.c.m. in number theory we shall mention only a single other example of such systems. Let A and Fig. 5-2. B be two sets of points or, more general, of elements of some sort. One can picture A and B as the shaded portions of the plane in the illustration (see Fig. 5-2). Then the union or sum A u B of the two sets consists of the elements that belong to either A or B, while the cross-cut or intersection A n B contains the common elements to A and B. In the figure A u B is the whole shaded part of the plane while A n B is doubly shaded. The reader will have no difficulty in verifying that the four pairs of axioms for a lattice are satisfied. 106 NUMBER THEORY AND ITS HISTORY In most such lattice systems there are further rules which the two operations satisfy. This is, for instance, the case in the theory we are particularly interested in here, namely, the g.c.d. and l.c.m. of numbers. The two subsequent theorems can be interpreted as giving laws of this kind. Theorem 5-9. For any three integers a, b, and c one has the rules (a, [b, c]) = [(a, 6), (a, c)] (5-33) and [a, (b, c)] = ([a, b], [a, c]) (5-34) connecting the greatest common divisor and the least common multiple. One is the dual of the other. One can express the law (5-33) in the form that the g.c.d. of a number a with the l.c.m. of two numbers b and c may be found by computing the g.c.d. of a with b and c separately and taking the l.c.m. of the results. The second rule (5-34) can be stated analogously. These laws are commonly called the distributive laws. To prove the equality (5-33) it is probably simplest to use the unique factorization theorem and verify for each prime that the exponents to the various powers to which it is raised on both sides are the same. We assume that some prime p divides the numbers a, b, and c to powers with the exponents a, /3, and y, respectively. Since b and c appear symmetrically in (5-33), there is no limitation in arranging the notation such that j8 ^ y. Then the exponent of the power of p contained in [b, c] is 0. Consequently, the left- hand side of (5-33) contains p to a power with the exponent min (a, /3) (5-35) On the other hand, in (a, b) and (a, c) the prime p occurs with the exponents min (a, /3), min (a, y) Since ^ y the first of these numbers is the larger, so that the right-hand side of (5-33) also contains p to a power with the exponent (5-35). This completes the proof of (5-33), and the equality (5-34) may be derived quite analogously. THE ALIQUOT PARTS 107 There exists another interesting identity, which we shall now derive: Theorem 5-10. For any three integers a, b, and c one has ([a, 6], [a, c], [b, c]) = [(a, b), (a, c), (b, c)] (5-36) This formula is peculiar in that it states that a certain expression involving the g.c.d. and l.c.m. of three numbers is self-dual, i.e., it remains the same when the two operations are interchanged. As before, to prove (5-36) , let a, /3, and y be the exponents of the powers to which some prime p divides a, b, and c. Since the expression (5-36) is symmetrical in a, b, and c, we can arrange the notation such that a ^ ^ y Then [a, 6], [a, c], and [b, c] contain p to powers with the exponents a, a, and |8, respectively. In their g.c.d. the exponent therefore is #. On the other hand, (a, b), (a, c), and (b, c) have the ex- ponents /3, y, and y, respectively, for p so that their l.c.m. contains p to a power with the exponent $. Thus for any prime p both sides in (5-36) contain the same power and consequently they are equal. One could also have derived (5-36) by using the rules in theorem 5-9. It should be noted that the rules (5-33) and (5-34) can be considered to be equivalent to properties of maxima and minima of three numbers a, 0, and y, namely : min {a, max (j3, y)} = max (min (a, (3), min (a, y)} max {a, min (|8, y)} = min {max (a, 0), max (a, y)} Similarly the result in theorem 5-10 is a consequence of min {max (a, j8), max (a, y), max (p, y)} = max {min (a, j8), min (a, y), min (/3, 7)} a law that remains invariant when maximum and minimum are interchanged. It is worth noting that the rules we have obtained in theorems 5-9 and 5-10 for the g.c.d. and l.c.m. have a much greater gener- 108 NUMBER THEORY AND ITS HISTORY ality than may appear from their derivation in our special field. These relations form a part of many other mathematical theories of importance. We shall mention only one instance, namely, the case of set operations, which we introduced above. Let us recall the notations that when A and B are sets, A u B denotes the union or sum set while A n B is their intersection or common part. Now let A, B, and C be three arbi- Fig. 5-3. Fig. 5-4. trary sets. We shall see how the relations become evident on the basis of simple illustrations. In our notation the distributive law (5-33) takes the form A n (B u C) = (A n B) u (A n C) In Fig. 5-3 the shaded part is the set of points common to A and the sum of B and C. Clearly this set may also be considered the sum of two sets, namely, the common part of A and B and the common part of A and C. Corresponding to (5-34) one obtains A u (B n C) = (A u B) n (.4 u C) In Fig. 5-4 the sum of A and the common part of B and C has been shaded. But it is evident that this set is also the common part of the sum sets of A and B and of A and C, as the formula requires. THE ALIQUOT PARTS 109 The analogue of the relation (5-36) is {A u B) n (A u C) n (B u C) = (A n B) v (A nC) v (B nC) In Fig. 5-5 the shaded part is found by inspection to consist of all points that are common to the three sum sets A u B, A v C, B v C Fig. 5-5. But it is also obvious that it is the sum of three sets, namely, the intersection sets An B, A n C, B n C as we wanted to verify. Problems. 1. Verify the relations in theorems 5-9 and 6-10 for the three numbers: 60, 72, 96. 2. The relations in the two theorems involve only the g.c.d. and the l.c.m. There exist several other relations that also contain multiplication and division. The reader may attempt to verify the relatively complicated identity (o6, cd) = (a, c) (b, d) (^ , 0^))((~J ' (675)) 5-5. Euler's function. When m is some integer, we shall con- sider the problem of finding how many of the numbers 1, 2, 3, . . . , m - 1, m (5-37) 110 NUMBER THEORY AND ITS HISTORY are relatively prime to to. This number is usually denoted by <p (to), and it is known as Euler's <p-f unction of m because Euler around 1760 for the first time proposed the question and gave its solution. Other names, for instance, indicator or totient have occasionally been used. Example. Among the positive integers less than 42 there are 12 that are relatively prime to 42, namely: 1, 5, 11, 13, 17, 19, 23, 25, 29, 31, 37, 41 so that ?>(42) = 12. For the first few integers one finds <p(2) = 1, *,(6) = 2, *>(10) = 4 <p(3) = 2, <p(7) = 6, <p(ll) = 10 *(4) = 2, *,(8) = 4, <p(12) = 4 *(5) = 4, *,(9) = 6, The value <p(l) is in itself without meaning, but by special definition one puts <p{\) = 1. In some cases the determination of <p(m) is particularly simple. When m = p is a prime, all numbers (5-37) except the last are relatively prime to p ; consequently, <p(p) = p - 1 When to = p a is a power of a prime, the only numbers in (5-37) that have a common factor with m are the multiples of p, p,2p, ... , p a ~ 1 p Since there are p a ~ 1 of these multiples, one has <p(p a ) = p a - p«~ l = p a ~ l (p - 1) = p a (l - i) (5-38) We shall now tackle the general case. Let p be some prime dividing w and let us first find the number <p p (m) of integers in THE ALIQUOT PARTS 111 (5-37) that are not divisible by p. This is simple since those that are divisible by p are the multiples m V, 2p, -..,-• V (5-39) V Since there are m/p of them, the remaining ones not divisible by p are, in number, m / 1\ <p p (m) = m = ra I 1 ) (5-40) V \ vl Next let q be some other prime dividing m. To find the number «^pg( w ) of integers in (5-37) divisible neither by p nor q, one must deduct from <p p {m) the m/q multiples of q q,2q,...,-q (5-41) Q But this procedure involves a duplication since the multiples (5-39) and (5-41) have some elements in common, namely, the m/pq multiples of pq, m pq, 2pq, . . . , —pq pq Instead of deducting m/q, we must only subtract m m q pq from (p p (m). Therefore the total of integers in (5-37) not divisible by p or q is -w-0-S-=0-;)-0-J)0-i) (5-42) We take the final step by mathematical induction. The results in (5-40) and (5-42) show that for t = 1 and t = 2, if p\, p 2 , . . . ,Pt are primes dividing m, there are o» - (m) = m ( i -£)( i 4)-"( i 4) (M3) g\ vl 112 NUMBER THEORY AND ITS HISTORY integers in (5-37) that are divisible by none of them. We assume that this formula (5-43) has been established for t primes and wish to show that it is correct when there is one further prime Pt+i- To determine the number of integers in (5-37) that are not divisible by any of the p x , . . . , p t nor by pt+i, one must sub- tract from (5-43) the number of multiples of p t+i m Pt+i, 2p t +i, • ■ • , Pt+i (5-44) Pt+i which have not already been stricken out. A multiple m ap f+1 , a = 1, 2, . Pt+i has, however, been taken into consideration previously if, and only if, a is divisible by one of the primes p\, . . . , pt- But according to our formula (5-43), there are m Pt+i numbers in the series o-a-o-s) 1,2, m Pt+i not divisible by any p x , . . . , p t . One concludes that in (5-37) there are *■ '^ {m) = m ( 1 ~p[)'"( 1 ~i) _J!L( 1 _!)...( 1 _I) Pt+l\ Pi/ \ Pt/ \ Pi/ \ pt/\ Pt+l/ numbers not divisible by any p 1} p 2 , . . . , Pt+i- This establishes our rule (5-43) in general. To obtain Euler's (^-function let m = pi ai • ■ • p r ar (5-45) THE ALIQUOT PARTS 113 be the prime factorization of the given number. An integer in (5-37) is relatively prime to m only when it is not divisible by any of the primes p x , . . . , p r . The result that we just derived yields, therefore : Theorem 5-11. Let m be an integer whose various prime factors are pi, . . . , p r . Then there are „(„)-„(! -!)...(! -I) (5-46) integers less than and relatively prime to m. Example. For m = 42 the prime factors are 2, 3, and 7, so that *>(42) = 42 • (1 - i) • (1 - i) ■ (1 - i) = 12. A table of the values of the ^-function for all numbers up to 10,000 has been computed by J. W. L. Glaisher. The expression (5-46) for Euler's ^-function can be written in slightly different forms. By means of the prime factorization (5-45), one finds <p(m) = p^ • • • p r (l - -^ • • • (l - -) = Pi ai ~ 1 (Pl ~ \)---Pr ar - l {Pr- 1) = (Pi" 1 ~ Vi ai ' 1 ) ■ ' • (Pr"' ~ Pr *" 1 ) When the last expression is compared with the formula (5-38) for the ^-function of a prime power, one sees that <p(m) = <p{ V r) • • • <p(Pr ar ) From this result one concludes further that when m = a • 6 where a and b are relatively prime, one has <p(m) = <p(a) ■ <p(b) 114 NUMBER THEORY AND ITS HISTORY This is analogous to the property expressed in (5-8) for the sum a (w) of the divisors of a number. We shall deduce only one further fact about Euler's function : Theorem 5-12. When d runs through all divisors of a number m, the sum of all the corresponding ^-function values <p(d) is equal to m T.<p(d) = m (5-47) Before we establish a proof of this theorem we shall illustrate it. Example. The number to = 42 = 2 • 3 • 7 has eight divisors, namely, d = 1, 2, 3, 6, 7, 14, 21, 42 For these one finds v (l) = 1, *(7) = 6 <p(2) = 1, <p(U) = 6 <p(S) = 2, *>(21) = 12 *(6) = 2, <p(42) = 12 and the sum of these values is to = 42. In the special case where m = p a is a power of a prime, the proof of the relation (5-47) is particularly simple. The divisors of m are 1, P, V 2 , • ■ • i P a and one has *(1) + v (p) + *V) + *>(P 3 ) + • • • + <f(p a ) = 14-(p-l) + (p 2 -p) + (p 3 -p 2 )4-...4- ? )«-p^ 1 =^ (5-48) since all terms except p a cancel out. THE ALIQUOT PARTS 115 This result (5-48) facilitates the proof of the general theorem. We assume that m has the prime factorization (5-45) and form the product of the following expressions: ya) + <p{ Vl ) + <p( Pl 2 ) + • • • + <p( Pl ai )] X [<p(l) + <p(p 2 ) + <P(V2 2 ) + • • • + <p(p 2 a2 )] X fe(l) + <p(p r ) + <p( Pr 2 ) + • • • + <p( V r ar )} According to (5-48) these brackets are respectively equal to p A p 2 a \ ..., p* so that their product is m as in the right-hand side of (5-47). When the product of the brackets is formed, one takes one term from each of them and obtains all expressions <P(P1 S1 MP2 S2 ) ' • • <f(Pr Sr ) = <p(Pl S W 2 ' ' * Pr Sr ) where each 5» may take some value 0, 1, . . . , a;. But this means that the numbers d = Pi Sl P2* 2 ■ ■ ■ Pr Sr run through all divisors of m. The sum of all the terms resulting from the multiplication of the brackets is therefore Y,<p(d), and the formula (5-47) has been established. Problems. 1. Determine <p(N) and verify theorem 5-12 for the numbers (a) N = 120, (b) N = 365. 2. Prove the formula <p(m 2 ) = m • <p(m) 3. Find all numbers m such that <p(m) divides m. Bibliography Escott, E. B.: "Amicable Numbers," Scripta Mathematica, Vol. 12, 61-72 (1946). Glaisher, J. W. L. : Number-divisor Tables, Vol. 8, British Association Mathe- matical Tables, Cambridge, 1940. Poxjlet, P.: La Chasse aux nombres, 2 vols. Brussels, 1929, 1934. CHAPTER 6 INDETERMINATE PROBLEMS 6-1. Problems and puzzles. Riddles, puzzles, and trick questions constitute a part of the folklore over large parts of the world. Curiously enough, the American Indians seem to have had no feeling for this form of entertainment, since no trace of such problem lore has been found among them by anthropologists. However, in Europe, Africa, and Asia one finds a multitude of such problems; they spread with the cultural interchanges, often with a preservation of details that is remarkable. Many of the puzzles have a germ of mathematical content. They can often be recog- nized as interrelated by the faithfulness with which certain figures and forms of questions are reproduced, even in localities separated widely in time and place. Let us illustrate these observations by an outstanding example. One of our most important sources of ancient Egyptian mathe- matical knowledge is the Papyrus Rhind, now in the British museum. It is usually named for its previous owner, the Egyp- tologist Henry Rhind, or sometimes for the scribe Ahmes who copied it from earlier sources about 1800 b.c. The letters and figures are in hieratic writing. The papyrus contains in some- what systematic arrangement the solution of a variety of problems, many of them practical everyday questions not very different from those still encountered in our present-day school texts. But the almost magical esteem of early mathematical learning may be seen in the introductory statement to the manuscript wherein it is promised to give "directions for obtaining knowledge of all obscure things." 116 INDETERMINATE PROBLEMS 117 Most computations in the Papyrus Rhind have been relatively easy to decipher. However towards the end one finds a curious problem where the interpretation is not so certain. When tran- scribed it consists of a column of terms (see Fig. 6-1). Houses 7 Cats 49 Mice 343 Ears of wheat 2,401 Hekat measure 16,807 Total 19,607 It is preceded by a word that seems to mean estate, and in a secondary column the same answer, 19,607, has been obtained in a different manner. The figures one recognizes, of course, as the five powers of the number 7. Some commentators assumed directly that this would show that the Egyptian mathematicians had mastered the concept of powers at this early time and that the names houses, cats, and so on, were symbolic terms for powers of the various orders. However, scholars more familiar with the history of mathematics have pointed out that problems with the same figures are known from other sources. We have already mentioned the importance of the Liber abaci (a.d. 1202) by Leonardo Pisano in the intro- duction of Arabic numerals to Europe. Among the problems included in this work is the following curious one: Seven old women on the road to Rome, each woman has seven mules, each mule carries seven sacks, each sack contains seven loaves, with each loaf there are seven knives, and each knife is in seven sheaths. How many objects are there, women, mules, sacks, loaves, knives, and sheaths? Clearly Leonardo has borrowed this problem from the medieval entertainment lore of his time, 3,000 years after the compilation of the reckoning book of Ahmes. But one need not go so far abroad. The old English children's rhyme contains a jocular problem again based on the powers of the sacred number 7 118 NUMBER THEORY AND ITS HISTORY "As I was going to St. Ives, I met a man with seven wives Every wife had seven sacks Every sack had seven cats Every cat had seven kits Kits, cats, sacks, and wives How many were going to St. Ives?" According to the first line none of them was going to St. Ives as one would gleefully reveal to the victim after he had performed the lengthy computations. It seems likely that Leonardo's problem must have had the same twist of surprise in its original popular version. This brings us back to Ahmes's old problem, and it appears quite likely that it may have been introduced, like Leonardo's, because the figures were familiar from a trick question. As to a suitable formulation the reader may use his own imagination; perhaps it might have run somewhat as follows: "A man's estate included seven houses, each house had seven cats, for each cat there were seven mice, for each mouse there were seven ears of wheat, and each ear would yield seven measures of grain. How many things did he possess, houses, cats, mice, ears, and measures all?" Perhaps the answer finally should be none, because the owner was dead. Numerous other examples of the preservation of the ideas of mathematical puzzles may be given. Several medieval manu- scripts containing collections of popular problems are still extant, and many of these puzzles, with small variations, may be recog- nized in our present-day magazines almost every week. Let us mention only a few. 1. An old woman goes to market and a horse steps on her basket and crushes the eggs. The rider offers to pay for the damages and asks her how many eggs she had brought. She does not remember the exact number, but when she had taken them out two at a time, there was one egg left. The same happened when she picked them out three, four, five, and six at a time, but £ in • c-_ mi in 7 in • "fin i nnn \?4 94 )l „,™99 S^?0 D no 9 i/ avw 343 'VII 103,2 111199991X1 III 9999 III 70S, 61 mi999inn in 999 Sill 706,91 AWWV3 a»« a> n p o o> g in/-/ 7 t.db □.. in ' t-Skh s } drrfd u ? n-o - t'umt t'^u; ,9999 ¥¥ i ' 9999ii • 106,2 l 2 6,5 nn99|jj i 402,11 HI Will* If fe 706,91 dmdl Fig. 6-1. Problem from Parvus Rhind. Above, hieratic original; below, hieroglyphic transcription. Note that writing is from right to left. {Courtesy of Mathematical Association of America.) 119 120 NUMBER THEORY AND ITS HISTORY when she took them out seven at a time they came out even. What is the smallest number of eggs she could have had? 2. A cistern can be filled by one pipe in one hour, by another in two, by a third in three, and by a fourth in four. How long a time will it take for all four pipes together to fill it? 3. Two men have a full eight-gallon jug of wine and also two empty jugs taking five and three gallons. How can they divide the wine evenly? 4. Three jealous husbands must ferry a river with their wives. There is only one small skiff capable of taking two persons at a time. How can one transport all six across so that no wife is ever left with other men without her husband's being present? 5. Fifteen Christians and fifteen Turks were passengers on the same ship when a terrible storm arose. To lighten the ship, the captain orders that half the passengers should be thrown over- board to save the others. All 30 are placed in a circle, and one agrees to count out every ninth person and throw him over- board. Providence intervenes, and it turns out that all the Turks are thrown overboard and the Christians saved. How had the passengers been arranged? The importance of such problems as a matter of diversion has of course decreased, and certainly they cannot compete with our modern mechanized amusement industry; but as a part of our folklore they are far from extinct. An interesting side light on this fact came during the last war when long waiting was the most nerve-racking and the most common activity of the soldiers. At this time, as we already mentioned, teachers of mathematics received a surprising number of requests from servicemen both for the correct answers and for methods for solving puzzle problems. Often they had arrived independently at the solution through the most laborious guesses. 6-2. Indeterminate problems. There is a type of problem that occurs quite commonly in puzzles and whose theory con- stitutes a particularly significant part of number theory. These problems may appropriately be called linear indeterminate problems, for reasons that will become clear after some examples. INDETERMINATE PROBLEMS 121 One of the earliest occurrences of such problems in Europe is to be found in a manuscript containing mathematical problems dating from about the tenth century. It is believed possible that it may be a copy of a collection of puzzles which Alcuin prepared for Charlemagne. The problem we are interested in runs as follows : 1. When 100 bushels of grain are distributed among 100 persons so that each man receives three bushels, each woman two bushels, and each child half a bushel, how many men, women, and children are there? To formulate this problem mathematically let x, y, and z denote the number of men, women, and children, respectively. The conditions of the problem then give x + y + s=100, 3x + 2y + |z = 100 (6-1) As we shall see later there are several solutions but Alcuin gives only the values x = 11, y = 15, z = 74 From an Arabic manuscript copied about a.d. 1200, but un- doubtedly composed earlier, we take this example : 2. One duck may be bought for 5 drachmas, one chicken for 1 drachma, and 20 starlings for 1 drachma. You are given 100 drachmas and ordered to buy 100 birds. How many will there be of each kind? When x, y, and z are the number of ducks, chickens, and starlings, it follows that x + y + z = 100, 5x + y + ^- = 100 (6-2) One may observe that the same number occurs on the right-hand side in both equations (6-1) and in (6-2). This particular pref- erence in the choice of the figures in the questions is common in Arabic, Chinese, and medieval European problems, and it undoubtedly points to an interrelated or common background. 122 NUMBER THEORY AND ITS HISTORY Even the use of the special number 100 shows a peculiar persist- ence in problems from all these sources. One finds similar questions in the many medieval collections of problems. They occur in Leonardo's Liber abaci (a.d. 1202), probably derived from Arabic sources, and in the following centuries they became increasingly popular. To illustrate a fairly common type of formulation we quote from a German reckoning manual (Christoff Rudolff, 1526): 3. At an inn, a party of 20 persons pay a bill for 20 groschen. The party consists of men (x), women (y), and maidens {z), each man paying 3, each woman 2, and each maiden \ groschen. How was the party composed? Here the equations become x + y + z = 20, Sx + 2y + | = 20 (6-3) and the figures are so chosen that there is a unique solution x = 1, y = 5, z = 14. It is, of course, not certain that this type of problem originated within a single cultural sphere, but if so, it seems likely that India should be looked to for its source. As early as the arithmetic of Aryabhata (around a.d. 500) one finds indeterminate problems. Brahmagupta (born a.d. 598) in his mathematical and astronomical manual Brahma- Sphuta-Siddhanta ("Brahma's correct system") not only introduces them, but gives a perfected method for their solution that is practically equivalent to our present procedures. The method is called the cuttaca or pulverizer and is based upon Euclid's algorism. Brahmagupta's examples are almost all of astronomical character and refer to the comparisons between periods of revolution of the heavenly bodies and determinations of their relative positions. We take the following problem from the Lilavati by Bhaskara, a work we have already mentioned: 4. Say quickly, mathematician, what is the multiplier by which two hundred and twenty-one being multiplied and sixty-five added INDETERMINATE PROBLEMS 123 to the product the sum divided by one hundred and ninety-five becomes exhausted? Here one wishes to find some x satisfying the condition 221* + 65 = 195?/ (6-4) In the Lilavati, as well as in other Hindu treatises on mathe- matics, one finds many problems in the flowery style so customary in Hindu writings. This problem is from the Bija-Ganita, literally meaning seed-counting but denoting algebra, also composed by Bhaskara : 5. The quantity of rubies without flaw, sapphires, and pearls belonging to one person is five, eight, and seven respectively; the number of like gems appertaining to another is seven, nine and six; in addition, one has ninety-two coins, the other sixty-two and they are equally rich. Tell me quickly then, intelligent friend, who art conversant with algebra, the prices of each sort of gem. In Hindu mathematics colors were used to denote the various unknowns, black, blue, yellow, red, and so on. If we prosaically denote the prices of rubies, sapphires, and pearls by x, y, and z, the condition becomes 5x + %y + 7z + 92 = 7x + 9y + 62 + 62 (6-5) A further example may be taken from Mahaviracarya's work Ganita-Sara-Sangraha, probably composed around a.d. 850: 6. Into the bright and refreshing outskirts of a forest which were full of numerous trees with their branches bent down with the weight of flowers and fruits, trees such as jambu trees, date-palms, hintala trees, palmyras, punnaga, trees and mango trees — filled with the many sounds of crowds of parrots and cuckoos found near springs containing lotuses with bees roaming around them — a number of travelers entered with joy. There were 63 equal heaps of plantain fruits put together and seven single fruits. These were divided evenly among 23 travel- ers. Tell me now the number of fruits in each heap. 124 NUMBER THEORY AND ITS HISTORY It is quite an anticlimax to state that if x is the number of fruits in each heap, one must have 63z + 7 = 23?/ (6-6) This beautiful Hindu forest contains a number of other problems, but after all these ancient examples let us conclude with one with a more modern touch. The following letter was one among several similar ones received by the author during the recent war: Dear Sir: A group of bewildered GI's at Guadalcanal, most of whom have been out of school for a good many years and have forgotten how to solve algebraic problems, have been baffled by what appears to be a very simple problem. Some of them affirm that it cannot be worked other than through the trial and error method, but I maintain that it can be worked systematically by means of some sort of formula or equation. [7.] Here is the problem : A man has a theater with a seating capac- ity of 100. He wishes to admit 100 people in such a proportion that will enable him to take in $1.00 with prices as follows: men hi, women 2j£, children 10 for one cent. How many of each must be admitted? Can this problem be solved other than through the laborious trial and error method? We shall greatly appreciate your assistance in helping us to find the solution, thus relieving our weary brains. Yours truly, P.S. Through the trial and error method we found the answer to be 11 men, 19 women, and 70 children. In terms of equations we have the conditions x + y + z = 100, 5x + 2y + ^ = 100 (6-7) Here again our familiar number 100 figures on the right. It is also clear that the figures are not adapted to the present movie prices and that we are confronted with an ancient problem which has gained in actuality by being put in modern dress. 6-3. Problems with two unknowns. We have presented a whole series of examples of linear indeterminate problems. As INDETERMINATE PROBLEMS 125 we saw, they lead to one or more linear equations between the unknown quantities. Furthermore, the number of unknowns is greater than the number of equations so that if there were no limitations on the kind of values the solutions could take, one could give arbitrary values to some of the unknowns and find the others in terms of them. For instance, in problem 4 one could simply write 195y - 65 x = 221 and any value of y would give a corresponding value of x. How- ever, by the terms of the problems, the choice of solutions is limited to integral values and usually also to positive numbers. But even with these restrictions, the solutions may be indetermi- nate in the sense that there may be several, or even an infinite number of them, as we shall see. On the other hand there may be no solution at all. Clearly many of our previous problems could be solved by probing, by trial and error, and in medieval times this procedure must have been commonly used. In several problems the possi- bilities are rather limited so that not many attempts need to be made. We have already mentioned that a method for solving linear indeterminate problems was found quite aarly by the Hindu school of mathematics. In Europe a corresponding method was not discovered until a millenium later, and the date of rediscovery can be fixed quite accurately. In 1612 there appeared in Lyons a collection of ancient puzzles under the title: Problemes plaisans et delectables, qui se font par les nombres. The author was Claude- Gaspar Bachet, Sieur de Meziriac (1581-1638), a gentleman, scholar, poet, and theologian, ardently devoted to classical learning. His work proved popular and a second enlarged edition appeared in 1624. Here one finds for the first time his rules for solving indeterminate problems. One of Bachet's problems runs about as follows : 8. A party of 41 persons, men, women, and children, take part in a meal at an inn. The bill is for 40 sous and each man pays 4 126 NUMBER THEORY AND ITS HISTORY sous, each woman 3, and every child \ sou. How many men, women, and children were there? In this case we have the equations x + y + z = 41, 4x + Sy + | = 40 (6-8) Bachet's procedure unfortunately is complicated by a lack of algebraic symbolism. In the following sections we shall make a more systematic study of the linear indeterminate problems. Here we prefer to present a method of repeated reductions that is easy to explain. It works quite well when the numbers involved are not too large, as, for instance, in most of the examples we have already mentioned. This method was used extensively by Euler in his popular Algebra (1770), which devotes much space to inde- terminate problems. We shall deal first with a single linear equation ax + by = c (6-9) in two unknowns. As a preliminary example we take simply x + 7y = Sl (6-10) which may be written x = 31 - 7y (6-11) This shows that any integral value substituted for y in (6-11) will give an integral value for x; for instance, y = Q,x = — 11; ory = 0, x = 31. Thus there will be an infinite set of pairs of solutions. But if one requires positive solutions, one must have both y > and x = 31 - 7y > thus y < 4f-. This gives only four possibilities, y = 1, 2, 3, 4, with the corresponding values, x = 24, 17, 10, 3, for the other unknown. This trivial example was introduced in order to show that when one of the coefficients of x and y in (6-9) is unity, as in (6-10), the solution is immediate. The guiding principle in the method INDETERMINATE PROBLEMS 127 used below is to reduce the more general equations in successive steps to this simple form. The first example given by Euler is: Write the number 25 as the sum of two (positive) integers, one divisible by 2 and the other by 3. The two summands may be taken to be 2x and Sy so that 2x + Sy = 25 (6-12) is the equation to be fulfilled. Since x has the smaller coefficient, we solve for x and find by taking out the integral parts of the fractional coefficients x = ^H>. 12 . iy + l±i (6 _ 13) Because x and y are integers, the quotient t - i±» (6-14) is integral. Conversely, any integral value t we may give to this quotient (6-14) will make y integral y = 2t - 1 and also x integral according to (6-13) x = 12 - 2y + t = 14 - St This shows that the general integral solution of (6-12) is x = 14 - St, y = 2t - 1 and one can verify by substitution that they actually satisfy the equation. Consequently, there is an infinite number of solutions, one for each integral t. For instance, when t = 10, x = —16, y= 19. But if one is limited to positive values, one must have x = 14 - St > 0, y = 2t - 1 > hence 128 NUMBER THEORY AND ITS HISTORY and there are only four permissible values, t = 1, 2, 3, 4. The corresponding solutions are x = 11, 8, 5, 2 V= 1, 3, 5, 7 This gives the decompositions 25 = 22 + 3 = 16 + 9 = 10 + 15 = 4 + 21 required in the original problem, as one could have verified without much effort by probing. This example requires only one reduction. In most cases two or more steps are required. Let us illustrate this by another example taken from Euler's Algebra. A man buys horses and cows for a total amount of $1,770. One horse costs $31 and one cow $21. How many horses and cows did he buy? When x is the number of horses and y the number of cows, the condition 31x + 2ly = 1,770 (6-15) must be fulfilled. Here y has the smaller coefficient so we solve for y and find 1,770 - 31x _ 6 - lOz /n N y = = 84 - x H (6-16) "21 21 V This requires that the quotient 6 - lOz t 21 shall be integral. Our task is, therefore, to find integers x and t such that 21* + lOx = 6 (6-17) As can be seen, this is an equation of the same type as (6-15) but INDETERMINATE PROBLEMS 129 with smaller numbers so that a first reduction has been performed. Since x has the smaller coefficient, we derive from (6-17) x = -2t + ^p (6-18) We conclude that x can only be integral when 6 - t is integral or t = 6 - 10m for some integer u. By substituting this value into (6-18) and then x into (6-16), one finds x = - 12 + 21m, y = 102 - 31m Any integral value of u will give integers x and y satisfying the equation (6-15) so that we have obtained the general solution. The form of the problem requires, however, that x and y must be positive. This leads to the conditions -12 + 21m>0, 102 - 31m > or There are, therefore, three possible values u — 1, 2, 3, and the corresponding solutions are s = 9, 30, 51 y = 71, 40, 9 We could have made the solution of the problem unique, for instance, by requiring in the formulation that the number of horses would be greater than the number of cows. As a last example of this type we shall take problem 4 in the preceding section, stated by Bhaskara. It is of interest because it permits us to mention some simplifications that often are avail- able in the solution of indeterminate problems. 130 NUMBER THEORY AND ITS HISTORY We observe first that in (6-4) the coefficients 221, 65, and 195 are all divisible by 13. This factor can, therefore, be canceled and the equation becomes 17s + 5 = 15y (6-19) Here, furthermore, both 5 and 15y are divisible by 5 so that 17s must have this factor. But 17 is prime to 5 so that x must be divisible by 5, and we can write x = bx\ When this is substituted in (6-19), one can cancel by 5 and have the still simpler equation 17si + 1 = 3y By writing this 17xi + 1 _ 1 - xi y = — — = fei + -3- we see that 1 — Xi = t 3 is integral. This gives #1 = 1 — 3* and x = 5xi = 5 - 15*, y = Q - 17t (6-20) as the general solution. Let us ask for the positive solutions. One obtains, as previously, the conditions 5 - 15* > 0, 6 - 17* > or ^ 3' * ^ 17 This shows that all values * = 0, —1, —2, • • • will give positive solutions in (6-20). To obtain positive values for this parameter or auxiliary variable, it is convenient in (6-20) to write t — ~u so that x - 5 + 15u, y = 6 -f- 17u INDETERMINATE PROBLEMS 131 becomes the general solution; all values u = 0, 1, 2, • • • give positive answers, namely, x = 5, 20, 35, 50, • • • y = 6, 23, 40, 57, • • • This example illustrates the fact that even when the solutions are required to be positive there may be an infinite number of them. Problems. 1. Divide 100 into two summands such that one is divisible by 7, the other by 11. (Euler.) 2. Required,, such values of x and y in the indeterminate equation 7x + IQy = 1,921 that their sum x + y may be the least possible. (From Barlow, An Ele- mentary Investigation of the Theory of Numbers, etc., London, 1811.) 3. In the forest 37 heaps of wood apples were seen by the travelers. After 17 fruits were removed the remainder was divided evenly among 79 persons. What is the share obtained by each? (Mahaviracarya. ) 4. Find two fractions having 5 and 7 for denominators whose sum is equal 35- 5. A party of men and women have paid a total of 1,000 groschen. Every man has paid 19 groschen and every woman 13 groschen. What is the smallest number of persons the party could consist of? (Modified from Euler. ) 6. How many different ways may £1,000 be paid in crowns and guineas? (Barlow.) [For non-English readers it may be recalled that one crown is 5 shillings, one pound 20 shillings, and one guinea 21 shillings.] 7. Solve problem 6 in Sec. 6-2. 8. Find a number that leaves the remainder 16 when divided by 39 and the remainder 27 when divided by 56. 6-4. Problems with several unknowns. We turn now to those indeterminate problems in which there are more than two un- knowns. There exists then a certain number of linear conditions; often the number of equations is just one less than the number of unknowns. The procedure is to eliminate some of the unknowns until one winds up with a single equation with two unknowns, which is the case we have just discussed. Most common is the case of two equations with three unknowns. In medieval times 132 NUMBER THEORY AND ITS HISTORY problems of this kind were known as problema coed, a term of unknown origin. The name probably refers to the fact that these problems often appeared in the form that a check should be paid by a certain number of people, as in the problem given by Bachet, for instance. Sometimes they were also called problema potatorum, referring to drinkers and the mixing of wine, or also problema virginum, believed to have originated through certain problems given in terms of Greek mythology from the so-called Palatine Anthology. The same problems are also reproduced in Bachet' s collection. In Euler's Algebra the regula coed is illustrated first by the following example: Thirty persons, men (x), women (y), and children (2), spend 50 thaler at an inn. Each man pays 3 thaler, each woman 2 thaler, and each child 1 thaler. How many persons were there in each category? The equations are x + y + z = 30, 3z + 2y + z = 50 (6-21 ) By subtracting the first from the second, one obtains an equation with two unknowns 2x + y = 20 The positive solutions are obviously x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 y = 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, and from the first of equation (6-21), one finds the corresponding values z = 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 Thus there are 11 solutions. For a less trivial example let us take problem 8 of Sec. 6-3, from Bachet. From the second of equation (6-8) it is clear that z must be a number divisible by 3 so that one can write z = Szi When this is substituted in (6-8), the two equations become x + y + 3zi = 41, 4x + Zy + z x = 40 INDETERMINATE PROBLEMS 133 When the last equation is multiplied by 3 and the first subtracted from it, one finds the equation with two unknowns lis + Sy = 79 To find its general solution we proceed as previously and write 79 - 11a; _ 3a; + 1 y = —j— = 10 - x - —£- Therefore the quotient 3x + 1 must be integral so that or is an integer and 8 8* = 3x + 1 x = St ! — 3 t = 3m - 1 Substituting this in the expressions for x and y, one obtains t v e general solution x = 8w - 3, y = 14 - 11m For positive solutions one must have 8m - 3 > 0, 14 - 11m > or | < u < 1-A- This leaves as the only possibility u = 1 and x = 5, y = 3. From either one of the equations (6-8), it follows that z = 33. Thus there is a single solution to Bachet's problem. Next let us consider the GI problem stated in (6-7). The second of these shows that z must be divisible by 10, hence z = 10zi, and the equations become x + y + IO21 = 100, 5x + 2m + z x = 100 (6-22) 134 NUMBER THEORY AND ITS HISTORY When the first equation is multiplied by 2 and subtracted from the second, one finds Zx - 19zi = - 100 (6-23) This equation may be solved as before. One writes 19 *i ~ 100 a oo , *i ~ l x = = 621 - 33 H — Therefore "^ is an integer, and one obtains z x = St + 1 and 2 = 30* + 10, x = 19t - 27 as the general solution of (6-23). When it is substituted in the first equation (6-22), it follows that y = 117 - 49* To make all three numbers positive, one must have 19* - 27 > 0, 30* + 10 > 0, 117 - 49* > or t > 1-JQ-, t > —$, t K 2^9- This is only possible for t = 2 so that one has the unique solution x = 11, y = 19, and z = 70, as already indicated. Let us discuss another type of problem with three unknowns, which occurs later in the theory of congruences: Find a number N that leaves the remainder 3 when divided by 11, the remainder 5 when divided by 19, and the remainder 10 when divided by 29. The conditions are in this case N = Ux 4- 3 = 19y + 5 = 292 4- 10 (6-24) Combining the two last conditions one has 19y = 292 + 5 INDETERMINATE PROBLEMS 135 One finds 102 + 5 and this shows that 102 + 5 _ 5(22 + 1) 19 ~ 19 is integral. Since 5 is relatively prime to 19, it follows that 22 + 1 is integral. This gives in turn t - 1 2 = 9^ + ^- so that we write t - 1 and find t = 2u + 1 and 2 = 19w + 9, y = 29m + 14 (6-25) These values for y and z give numbers N leaving the remainder 5 when divided by 19 and the remainder 10 when divided by 29. But one should also have the remainder 3 when the number is divided by 11. When the two first conditions in (6-24) are com- bined, one finds Ux = 19t/ + 2 Since the form of y is given by (6-25), it follows that x and u must be integers satisfying llx = 551w + 268 This gives u + 4 x = 50m + 24 + so that w + 4 11 136 NUMBER THEORY AND ITS HISTORY is integral. We have, therefore, u = lly — 4 and x = 55h> - 176 This in turn gives N = 6,061V - 1,933 as the general form of the numbers with the desired residue proper- ties. The positive values of v give positive N, and the smallest solution is obtained f or v = 1 when N = 4,128. Let us finally consider some problems in which the number of unknowns is at least two greater than the number of equations. In this case also, one can eliminate some of the unknowns and end up with a single equation with several unknowns. For instance there may be two equations and four unknowns and one of them may be eliminated to obtain a single equation with three unknowns. Problem 5 in Sec. 6-2, which we quoted from the Bija-Ganita of Bhaskara, is formally of this type. But (6-5) may be written simply as y = z - 2x + 30 and the solution is trivial. One can choose any integral positive x and z arbitrarily greater than 2x — 30 and find the corresponding y. In the solution given by Bhaskara the proportions x : y : z of the various prices are prescribed, and one obtains an ordinary equation in a single variable. A less trivial example from the same source, stated by Bhaskara to be a problem from ancient authors, runs as follows: Five doves are to be had for 3 drammas, seven cranes for 5, nine geese for 7, and three peacocks for 9. Bring 100 of these birds for 100 drammas, for the prince's gratification. When x, y, z, and t denote the numbers of doves, cranes, geese, and peacocks, the equations are x + y + z + t = 100, %x + f y + f z + 3* = 100 (6-26) When the first equation is multiplied by 3 and the second sub- tracted from it, one finds after the fractions have been cleared 189x + 180^/ + 175^ = 15,750 INDETERMINATE PROBLEMS 137 Here one may apply the same reduction method as for equations with two unknowns. Solving for z, which has the smallest co- efficient, it follows that 14x + by 175 2 = 90 — x — y — so that 14x + by is an integer. Thus we have the reduced equation 175w = 14z + by or This shows that x y = 35w — Sx + - 5 x is integral, and proceeding backward one finds x = bv, y = 35w — 14u z = 90 + 9v - 36w, t = u + 10 This represents the general solution of (6-26) in integers. The variables or parameters u and v are arbitrary integers. It should be noticed that in the case of one equation with two unknowns we obtained a general solution with one parameter, while in the case of three unknowns there will be two of them, as above. Our problem requires that the solutions shall consist of positive numbers. This in general leads to a set of inequalities, which at times may be bothersome to analyze to find all possibilities. In our special case we must have v > since x > 0, and consequently also u > since y > 0. These conditions then insure that x > and t > 0. From y > and z > one concludes v > 4m — 10, v < f u 138 NUMBER THEORY AND ITS HISTORY and therefore or Thus, there are the possibilities 1, 2, 3, 4, 5, 6, for u. Let us choose one of them, for instance, u = 2. When substituted in the general solution, this gives x = 5v, y = 70 - Uv, z = 18 + 9v, t = 12 Here y > so that v is limited, namely v < 5. The four possi- bilities v = 1, 2, 3, 4 correspond to the solution sets X y z t V = 1 5 56 27 12 «; = 2 10 42 36 12 *; = 3 15 28 45 12 v = 4 20 14 54 12 The first three of these are those actually given by Bhaskara. All the other possibilities for u and v may be investigated similarly. We shall leave it to the reader to derive all sets of solutions; it may only be stated that there are altogether 16 of them. From Euler's Algebra we take our final example: Someone buys 100 head of cattle for 100 thaler at the following prices: a steer, 10 thaler; a cow, 5 thaler; a calf, 2 thaler; and a sheep, | thaler. How many did he buy of each kind? Here are the equations. x + y + z + t = 100, 10z + by + 2z + }* = 100 We multiply the last equation by 2 and subtract the first from it, giving 19x + 9y + 32 = 100 This in turn leads us to x — 1 z = 33 - Qx - Sy INDETERMINATE PROBLEMS 139 Hence, the only requirement is that x - 1 shall be integral. One finds, therefore, the general integral solution in the form x = 3m + 1, z = 27 - 19m - Sy, t = 72 + 16m + 2y while y is arbitrary. Next one must analyze the conditions for positive solutions. Since x = 3u + 1 > one must have u ^ and naturally also y > 0. This is already sufficient to make t > 0. The remaining condition z > leads to 19m + 3y < 27 Clearly m can take only the values m = and u = 1. For u = 0, « can take the eight values y = 1, 2, • • • , 8. For m = 1 there are only the possibilities y = l,y = 2, and the two sets of solutions are s = 4, y = 1, 2 = 5. < = 90 4, 2, 2, 92 As these examples indicate, the determination of all positive solutions may often prove quite cumbersome. How complicated the matter may have appeared in earlier periods is evident from the following lament by an Arabic writer on the subject about a.d. 900. The title of his work is The Book of Precious Things in the Art of Reckoning, and the preface opens in this manner: In the name of God, the compassionate and merciful. The writer is Shod j a C. Aslam known by the name of Abu Kamil. I am familiar with a special kind of problems which circulate among high and low, among learned and among simple people, which they enjoy and which they find new and beautiful. But when one asks about the solution, one receives inaccurate and conjectural replies and they see in them 140 NUMBER THEORY AND ITS HISTORY neither principle nor rule. Many men, some distinguished and some humble, have asked me about problems in arithmetic and I replied to them for each separate problem with the single answer when there were no others. But often a problem had two, three, four and more answers, and often there was no solution. Indeed it happened to me in one problem which I solved that I found very many solutions. I considered the matter more penetratingly and came upon 2676 correct solutions. At this my surprize was great and I had the experience that when I told of the discovery, I was met with astonishment or was considered incom- petent or those who did not know me had a false suspicion of me. Then I decided to write a book on the subject of such computations to facilitate the study and bring understanding nearer. This I have now begun and I shall declare the solutions for those problems which have several solutions and for those which have only one and for those which have none, all by means of an infallible method. Finally I shall treat a problem, which as I stated, has 2676 solutions. The suspicions will again disappear and my statement will be confirmed and the truth will show itself. It would carry too far if I should add more about the opinions which have been expressed to me in regard to the great number of solutions of this and similar problems. To satisfy the curiosity of the reader it may be stated that the problem is of the same type as those considered in the last two examples. It has five unknowns and it leads to the equations x + y + z + u + v = 100 2x + §y + iz + lu + v= 100 The reader is welcome to verify Abu KaimTs result. To conclude, let us mention only a famous indeterminate problem known as the "cattle problem of Archimedes." Although the problem is ancient, it appears doubtful whether it ever had any connection with Archimedes. It is in poetic form and in it one is requested to find the number of head of cattle of various colors in the herds of the sun-god Helios as they graze the slopes of Sicily. The problem leads to seven equations in eight unknowns. These equations are quite simple and present no theoretical difficulty, but the numbers appearing in the solutions are enormous. INDETERMINATE PROBLEMS 141 A later addition requires the solution of second-degree indetermi- nate equations. Problems. 1. Solve problems 1, 2, and 3 in Sec. 6-2. 2. The following problems are quoted from the letters of the German mathematician Regiomontanus (1436-1476). In all of them, find the positive integral solutions. (a) 97x + 56y + 3z = 16,047 (b) 17x + 15 = lBy + 11 = 10s + 3 (c) 23x + 12 = 17y + 7 = 10s + 3 3. Write ^ as a sum of three fractions with relatively prime denominators. 4. Find the number of solutions in positive integers of the equation 5x + lly + 133 = 2,000 and find the solution for which the sum x + y + z is as small as possible. 5. In how many ways can one give change for (a) 25 cents, (b) 50 cents, (c) $1. Bibliography Bachet, C. G. : Prollemes plaisans et delectables qui se font par les nombres. Lyons, 1612. Many later editions. Chace, A. B., L. S. Bull, H. P. Manning, and R. C. Archibald: The Rhind Mathematical Papyrus, 2 vols., Oberlin, Ohio, 1927, 1929. Colebrooke, H. T. : Algebra with Arithmetic and Mensuration from the Sanscrit of Brahmegupta and Bhaskara, London, 1817. Euler, L. : Vollstandige Anleitung zur Algebra, St. Petersburg, 1770. Many English and French translations. Rangacarya, M. : The Ganita-Sara-Sangraha of Mahaviracarya, with English translation and notes, Madras, 1912. CHAPTER 7 THEORY OF LINEAR INDETERMINATE PROBLEMS 7-1. Theory of linear indeterminate equations with two unknowns. After the many examples of linear indeterminate problems we have given in the preceding chapter, it is time to consider some of the more systematic aspects of their theory. The following result is essential in many applications of number theory: Theorem 7-1. When a and b are relatively prime, it is possible to find such other integers x and y that ax -f- by — 1 (7-1) This may be stated slightly differently by saying that unity is a linear combination of a and b. The proof is an immediate appli- cation of Euclid's algorism. We suppose that a > b. To make the notation more systematic, we write a = r\ and b = r 2 in stating the algorism: n = Qir 2 + r z r 2 = 22*3 + r 4 r„_ 3 = g w _ 3 • r w _ 2 + ?V-i r„_ 2 = #n-2 • r n -\ + 1 , (7-2) The last remainder is 1 since a and b are relatively prime. We shall now obtain a representation (7-1) by a stepwise process 142 LINEAR INDETERMINATE PROBLEMS 143 derived from (7-2). We begin at the bottom and write 1 as a linear combination of r„_2 and ?v_i 1 = *»_2 — gn_2^n-l Here we substitute from the next to the last division 7n_i = r„_ 3 — q n -3 r n-2 and one obtains after rearrangement 1 = — g f n-2»*n-3 + (1 + g f n-2Q , n-3)»'n-2 so that we have represented 1 as a linear combination of r n _ 3 and r„_ 2 . From the third last relation one introduces Tn—2 ~ ^n— 4 ~~ Qn— 4^"n— 3 and in a similar manner one expresses 1 linearly by means of r n _4 and r n _ 3 . This process is continued until one arrives at a linear combination of r x = a and r 2 = b equal to 1, as the theorem requires. Let us illustrate the procedure on the example a = 109 and b = 89. The algorism is 109 = 89-1 +20 89 = 20-4 + 9 20 = 9-2 + 2 9 = 2-4 + 1 where the various remainders have been underscored to keep them separate from other figures occurring in the reductions. We begin by writing 1=9-4-2 and substitute 2 = 20 - 2-9 from the third division. This gives 1 = 9-9 - 4-20 144 NUMBER THEORY AND ITS HISTORY Here we substitute 9 = 89 - 4-20 from the second relation and obtain 1 =9-89-40-20 In the last step we use the first division and write 20 = 109-89 so that we arrive at the desired representation 1 =49-89-40-109 It should be observed that when the algorism (7-2) was used to derive a solution of the equation (7-1), it was immaterial what the values of the remainders r. were, as long as one had a set of relations of the type (7-2). This remark may be used to shorten the algorism in some cases, for instance, by taking least absolute remainders instead of least positive remainders. To illustrate we shall take a = 249 and b = 181, for which one finds 249 = 181-1+68 181 = 68-3-23 68 = 23-3-1 Again, in 1 = 3.23 -68 we substitute the expression for 23 from the second relation and derive 1 =8-68-3-181 When 68 is eliminated in the same manner by means of the first relation, we obtain as a solution to our linear equation 1=8 -249 - 11 -181 The work involved in the computation of a solution of the linear equation (7-1) may be reduced considerably by a systematic LINEAR INDETERMINATE PROBLEMS 145 arrangement. Before we give the necessary proofs we shall illustrate the method on the example 1,027a; + 712*/ = 1 Here the algorism is 1,027 = 712 • 1 + 315 , 712 = 315 • 2 + 82, 315 = 82-3 + 69, 82 = 69-1 + 13, 69 = 13-5 + 4, 13 = 4-3 + 1, = -165 • 1,027 + 238-712 73 • 712 - 165 • 315 -19 -315 16-82 -3 -69 1 -13 0-4 + 73-82 - 19-69 + 16-13 - 3-4 + 1-1 In the second column we have performed the substitutions required by our method, beginning at the bottom and proceeding succes- sively to the solution on top. The lowest equation has been added as a supplement for a reason that will be clear instantly. To derive the rules of computation we shall establish, let us rewrite separately the coefficients in the right-hand column of equations above. -165 238 73 -165 -19 73 16 -19 -3 16 1 -3 1 The two columns are the same except for one element at each end, so that we have the rule that the last coefficient in one equa- tion becomes the first in the next. Furthermore the signs alternate. Consequently, to obtain our solution x = —165 and y = 238, it would suffice to compute the positive values of the numbers in the last column, and then give them the signs plus and minus 146 NUMBER THEORY AND ITS HISTORY alternatingly. This may be executed according to the following scheme : 1 238 = 165 •1+73 2 165 = 73 •2 + 19 3 73 = 19 •3 + 16 1 19 = 16 1+ 3 5 16 = 3 5+ 1 3 3 = 1 3+0 In the first column we have written the quotients which occur in the divisions on the Euclid algorism. In the second column are the positive coefficients, each computed as indicated, by multiply- ing the corresponding quotient by the preceding coefficient and adding to the product the next preceding coefficient. The proof of these rules is quite simple. Suppose that for some i we have found the relation 1 = -^i+l^' + A.{Tir\-\ To eliminate the remainder r l+1 one must substitute r i+\ = r i—\ — fiQi—1 from the algorism and one obtains 1 = A,r,-_i - (Afti-i + A i+l )ri This shows that the coefficient of r t -_i is the same as that of r i+1 in the preceding and also that one must put Ai_ x = - (A^i + Ai+i) However, these are exactly the rules that were verified in the exam- ple above. To give a final illustration of the scheme let us take the equation 1,726a; + l,229y = 1 LINEAR INDETERMINATE PROBLEMS 147 The algorism is 1,726 = 1,229 -1 + 497 639 1,229 = 497 • 2 + 235 455 497 = 235 • 2 + 27 184 235 = 27-8+19 87 27 = 19-1 + 8 10 19 = 8-2 + 3 7 8 = 3-2 + 2 3 3 = 2-1 + 1 1 1 The last column contains the computation of the successive coeffi- cients by means of the quotients in the algorism. The two top numbers give the solution x = -455, y = 639, as is readily verified. In this example, as well as in the preceding, we have assumed positive coefficients in the linear equation to be solved, and this is usually convenient. In order to find the solution of equations with negative coefficients, one need only observe that if x and ?/o is a solution of (7-1), then — xq, y Q) x , ~y , —x , —y respectively are solutions of the equations -ax + by = 1, ax - by = 1, -ax - by = 1 We shall turn next to the general linear equation in two unknowns ax + by = c (7-3) On the basis of the preceding analysis it is not difficult to find when such an equation can have integral solutions. Clearly, if the coefficients a and b in (7-3) have the greatest common divisor d, this factor must also divide c when there is to be an integral solu- tion. Conversely, let d divide c. Then one can divide (7-3) 148 NUMBER THEORY AND ITS HISTORY by d and obtain an equation in which a and b are relatively prime. Let us suppose that this has been done. It follows from theorem 7-1 that one can find integers x and y such that ax + by = 1 When this equation is multiplied by c, one finds a(cx ) + b(cy ) = c and therefore x = cx , y = cy is a solution of (7-3). To summarize we state: Theorem 7-2. The necessary and sufficient condition for the equation ax + by = c to have a solution in integers is that the greatest common divisor of a and b divide c. Examples. 1. The equation 114x + 312y = 28 has no solution in integers since the g.c.d. of 114 and 312 is 6 and this number does not divide 28. 2. The equation 208a; + 136y = 120 (7-4) has solutions, since (208, 136) = 8 and this common divisor divides 120. After canceling by 8, we have the equation 26x + lly = 15 (7-5) As indicated above, we first find a solution of the equation 26z + 17y = 1 (7-6) The algorism is 26 = 17 1+9 3 17 = 9 1 +8 2 9=8 1 + 1 1 1 LINEAR INDETERMINATE PROBLEMS 149 The last column contains the computation of the successive coefficients so that a solution of (7-6) is x = 2, y = —3. When these values are multiplied by 15, one obtains a solution x = 30, y = -45 of any of the two equivalent equations, (7-4) or (7-5). 3. To find a solution of the equation l,726x + 1,229?/ = 3 (7-7) we recall that we have already shown previously that the equation l,726x + l,229y = 1 has the solution x = -445, y = 639 When these numbers are multiplied by 3, one arrives at the solution x = -1,335, y = 1,917 for (7-7). So far we have derived only one solution of the indeterminate equations we have studied. However, on the basis of one solu- tion it is not difficult to find the general solution. We have already established that when there exists a solution of (7-3), the greatest common factor of a and b also divides c so that it may be canceled. We shall suppose in the following, therefore, that this has been done and a and b are relatively prime. When x and y form some particular solution of (7-3), one has ax + by = c (7-8) To find the general solution x and y, we subtract (7-8) from (7-3) and obtain a(x - xq) + b(y - y ) = which we prefer to write a(x - xo) = ~b(y - y ) (7-9) This equation shows that the product of a and x — x is divisible by &. Since a is relatively prime to b, we conclude that x — x is divisible by b so that one can write x — Xq = tb 150 NUMBER THEORY AND ITS HISTORY where t is some integer. When this is substituted back in (7-9) and b is canceled, one obtains y - Vo = -ta Thus we have shown that one must have x = x + tb, y = y — ta (7-10) It may be verified directly that these values for x and y satisfy (7-3) regardless of the value of the integer t; hence in (7-10) we have the general form for the solution of the indeterminate equation. By means of the general solution one can answer various ques- tions about the existence of solutions with particular properties. Let us again consider some illustrations. Examples. 1. Find the smallest positive integer that leaves the remainder 1 when divided by 1,000 and the remainder 8 when divided by 761. The number must have the form N = 1,000s + 1 = 761y + 8 (7-11) so that l,000z - 761y = 7 (7-12) A solution of the equation l,000x - 7Qly = 1 is found by the previous method to be x = 121, y = 159 When multiplied by 7, it gives the solution to (7-12) x = 847, y = 1,113 and the general solution becomes x = 847 - 761i, y = 1,113 - 1,000< (7-13) The smallest positive values for x and y are obtained when t = 1 and they are x = 86, y = 113 (7-14) The corresponding number asked for in the problem is, according to (7-11), A = 86,001. LINEAR INDETERMINATE PROBLEMS 151 In forming the general solution one could also have used the particular solution (7-14) so that x = 86 - 761*, y = 113 - 1,000* would be the general form, instead of (7-13). However, when * runs through all integers, the totality of solutions is, of course, the same in both forms. Let us also mention that since — * runs through all integers when * does, one could also present the general solution as x = 86 + 761*, ?/ = 113 -h 1,000* 2. Find the number of positive solutions to the equation lOx + 28?/ = 1,240 We first cancel the common factor 2 so that the equation reduces to 5x + Uy = 620 By inspection one sees that a particular solution of 5x + 14t/ = 1 is x = 3, y = — 1. When this is multiplied by 620, it gives the particular solution x = 1,860,7/ = —620 for the previous equation. The general solution is therefore x = 1,860 - 14*, y = -620 + 5* To obtain positive solutions one must have 1,860 6 * < ——- = 132 - , * > 124 14 7 or 132 ^ * ^ 125 so that there are 8 positive solutions. For * = 124 one finds y = 0. One can also look at this theory of linear indeterminate equations from a geometric point of view. In analytic geometry, an equation ax + by = c represents a straight line. The points (x, y) in the plane whose coordinates x and y are integers are called lattice points. To solve the linear equation in integers means, therefore, to determine those lattice points that lie on the line. The general form of the integral solutions, as we have found it, shows that if (x , y ) is 152 NUMBER THEORY AND ITS HISTORY a solution, then there are lattice points on the line for all the abscissas x , xq dt a, x ± 2a, This means that the lattice points that represent solutions lie at ^x Fig. 7-1. even intervals on the line with abscissas differing by a, and simi- larly, with ordinates y differing by b. The situation has been illustrated in the figures representing the two lines 2x + Zy = 11, 3z - Ay = 1 These two illustrations clarify another fact. One can write the equation for the straight line in the form y a c l x + l LINEAR INDETERMINATE PROBLEMS 153 Therefore the slope of the line is positive when a and b have different signs, as in the second example. But when the slope is positive, the line must have an infinitely long portion in the first quadrant, in which both x and y are positive, so that when a and b have different signs, there will be an infinite number of positive integral solutions, provided of course that there are any at all. On the other hand, when a and b have the same sign, for instance, both positive as in the first example, the line, if it goes through the first quadrant, can have only a finite portion in this part of the plane. In this case there can at most be a finite number of positive solutions. Problems. 1. Find the general integral solution and also the positive solutions for each of the following equations : (a) 39x - 56y = 11 (b) 311a; + 712y = 1,300 (c) 7x + 13y = 71 (d) 39x - 11% = 49 (e) 170x - 445y = 625 2. Find the number of positive solutions of the equations (a) 33x + 41y = 1,946 (6) 31x - ly = 2 (c) 3x + \\y = 1,000 7-2. Linear indeterminate equations in several unknowns. So far we have discussed the theory of linear indeterminate equations in two unknowns in considerable detail. We turn next to such equations with several unknowns. These equations, as we saw in the examples, will appear in problems in which the number of unknowns is one or more greater than the number of equations. The basic result for several unknowns is quite analogous to the main result for two unknowns as we expressed it in theorem 7-1. In a slightly different form this theorem may be stated: When d is 154 NUMBER THEORY AND ITS HISTORY the greatest common divisor of two numbers a and b, one can find two other integers x and y such that ax -\- by = d (7-15) For several unknowns we shall derive the corresponding theorem : Theorem 7-3. Let ci\, a 2 , . . . , a n be a set of integers with the greatest common divisor d = (ai, a 2 , - - • , a n ) Then one can find such integers that aixi + a 2 x 2 + • • • + a n x n = d (7-16) To prove this theorem one can proceed in various ways. We shall prefer to use the induction method, and to this end we need to observe that the result is obviously true when there is only one number a± (then d = a x and x\ = 1). Also we have just men- tioned that the theorem is true when there are two numbers a\ and a 2 . The induction consists in supposing that the theorem is true when there are n — 1 numbers ai and applying this to prove it for n numbers. We shall denote by dn— i = (fli, ' ' ' j tt,i_i) the g.c.d. of the n — 1 first numbers. According to our assump- tion, we can find n — 1 numbers y 1} ... , yn-i such that a\V\ + • • • + an-i^/n-i = dn-i (7-17) But let us recall from the properties of the g.c.d. that d, the g.c.d. of all ai's is also the g.c.d. of d n _\ and a n d = (d n -l, On) LINEAR INDETERMINATE PROBLEMS 155 This means that one can find two integers t and x n so that When we put in the value of d n _i from (7-17), we arrive at the relation aiVit + • • • + a-n-iyn-it + a n x n = d and this is exactly of the form (7-16) when we write xi = yit, x 2 = y 2 t, " • , x n _ x = y n -it This proof has the advantage of providing a fairly simple method of computing a solution to (7-16). Example. The three numbers a x = 100, a 2 = 72, a 3 = 90 have the g.c.d. d = 2, and we shall find numbers x\, x% and x% such that lOOxi + 72x 2 + 60x 3 = 2 (7-18) The g.c.d. of 100 and 72 is d% = 4 so that we begin by solving the equation lOOr/i + 72y 2 = 4 or 252/i + 182/ 2 = 1 By the usual method one finds a solution 2/1 = —5, 2/2 = 7. In the next step we solve 4i + 90x 3 = 2 or 2t + 45x 3 = 1 By inspection one sees that X3 = 1, t = —22 satisfies this equation. By mul- tiplying 2/1 and 2/2 by —22 one obtains as a solution of (7-18) xi = 110, x 2 = -154, x 3 = 1 (7-19) Analogously, as in the case of two unknowns, one can prove further: Theorem 7-4. The necessary and sufficient condition for the equation a\Xi + • • • + a n x n = c (7-20) 156 NUMBER THEORY AND ITS HISTORY to be solvable in integers x\, . . . , x n is that c be divisible by the greatest common divisor of all numbers a*. The proof is simple. Since d, the g.c.d. of all numbers a*, divides each of them, it must also divide c if there is to be an integral solution. On the other hand, when c is divisible by d, one can divide all terms in (7-20) by d and obtain a new equation in which the coefficients of the unknown have 1 for their g.c.d. Let us suppose that this reduction has already been carried out in (7-20). Then according to theorem 7-3 one can find such integers y 1} . . . , y n that «i2/i + • • • + a n y n = 1 When this relation is multiplied by c, one has ai(cyi) + • • • + a n (cy n ) = c so that the multiples Xi — cyi give a solution of (7-20). Examples. 1. Let us take first the equation lOOxi + 72a; 2 + 90x3 = 11 Since the g.c.d. of 100, 72, and 90 is d = 2, and since this number does not divide c = 11, the equation has no integral solution. 2. On the other hand, the equation 100xi + 72x 2 + C0x 3 = 6 (7-21) does have solutions according to our criterion since d = 2 divides c = 6. To find one of them we divide (7-21) by 2 and obtain 50xi + 36x 2 + 45x 3 = 3 (7-22) and then solve the equation 50yi + 36i/ 2 + 45y 3 = 1 This, however, is the same as (7-18) divided by 2, so that (7-19) gives a solution to it. When these numbers are multiplied by 3, one finds xi = 330, x 2 = -462, x 3 = 3 to be a solution of (7-21) and (7-22). When there were only two unknowns, it was fairly simple to derive the general solution as soon as one knew a particular set of LINEAR INDETERMINATE PROBLEMS 157 values satisfying the equation. For several unknowns, the situa- tion is more complicated, as we have already seen in the examples in Chap. 6. We indicated there how one could find the general solution by a series of reductions, and this method is probably the best available. Let us illustrate it once more by deriving the general solution of (7-22). We begin by writing 3 - 50;zi - 45^3 3 - 14zi - 36 *> X3+ 36 - 9x 3 Therefore 3 — 142! — 9x 3 v — 36 is an integer. When this expression is solved for x 3 , it follows that ,, o , 3 + 4*! x 3 = At 2x 1 + Consequently 3 +Ax x u = 9 is integral and u - 3 Xi = 2u -\ 4 This gives finally that u - 3 v = 4 is integral and u = 4w + 3. When this is substituted, one finds as the general solution X\ = 9v + 6 x 2 = 5t + 5v + 3 x 3 = -At - 14u - 9 where v and t are arbitrary integers. 158 NUMBER THEORY AND ITS HISTORY Problems. 1. Find an integral solution to each of the equations: (a) 31a; + 49?/ - 22s = 2 (6) 120x + My + 1442 = 22 2. Find the general solution and the number of positive solutions of each of the equations: (a) Six + 49?/ + 222 = 1,000 (b) 102x + Zlly + 2022 = 10,000 7-3. Classification of systems of numbers. In mathematics one deals with many systems of numbers, characterized by various properties. It has gradually become evident that certain systems are of particular importance, namely, those that reproduce them- selves, or, as one prefers to say, are closed, under some or all of the four arithmetic operations, addition, subtraction, multiplica- tion, and division. For such systems there has come into use fairly recently a nomenclature we shall now explain. Although we shall use these terms only incidentally in subsequent chapters, they are of such importance and common occurrence even in fairly elementary mathematical writings that the reader should be familiar with them. Let S be a set of numbers of any kind. We shall say that S is closed under addition if, for any two numbers a and b in S, their sum a + b is also a number in S. It follows immediately that the sum of three, four, or any finite number of elements in S will again belong to S. Let us illustrate this definition by some examples. Example 1. The set of all natural numbers 1, 2, 3, ... is closed under addition. Example 2. The even integers form a system closed under addition. The odd integers are not closed under addition. Example 3. All positive real numbers form a system closed under addition. Example 4. The sets of all integers, all rational numbers, all real numbers, and all complex numbers are closed under addition. LINEAR INDETERMINATE PROBLEMS 159 The closure with respect to subtraction is defined analogously. We say that a set of numbers S is closed with respect to subtrac- tion, when the difference a — b of any two of its numbers again belongs to S. Such a set is called a modul. Example 1. The integers 0, ±1, ±2, . . . form a modul, but the natural numbers 1, 2, 3, ... do not. Example 2. The even integers form a modul. Example 3. The sets of all rational numbers, all real numbers, and all complex numbers are moduls. Example 4. All purely imaginary numbers ib form a modul. We shall now show that a modul has the following properties: Theorem 7-5. (a) A modul contains 0. (6) When a modul contains a it contains —a. (c) A modul is closed with respect to addition. Proof: When a is an element in a modul S, the difference a — a = is in S. Consequently — a = — a is in S, and there- fore also a + b = a — ( — 6) when a and b are in S. As a consequence a modul is sometimes defined as a system closed under both addition and subtraction. Since number theory deals primarily with the integers, we are interested in finding all moduls consisting only of integers. Clearly one type of such moduls may be obtained simply by taking all multiples k - a of some integer a because the sum and difference of two multiples is again a multiple. k\a ± k 2 a = (ki ± k 2 )a It is remarkable, however, that all moduls of integers are of this kind. This is a consequence of the following theorem, which we shall now prove: Theorem 7-6. Any modul M containing only integers consists of all multiples of the greatest common divisor of the numbers in M. We remark first that if a is some integer in a system that is closed under addition, every multiple k • a is also in the system 160 NUMBER THEORY AND ITS HISTORY since it is the sum of a taken k times. Second, let a and b be some integers contained in a modul M. Then k • b is in M for any integral ft and therefore also any difference r = a — kb In particular, we conclude that when a is divided by b, the remainder r is in the modul. To prove theorem 7-6 we select the smallest positive integer d in M. Such an integer must exist except in the trivial case where M consists of the single number 0. All positive and nega- tive multiples of d are in M, and they exhaust M. If, for example, m is some integer in M, we divide m by d m = kd + r, d > r ^ and r, as we remarked, also belongs to M. But since d was the smallest positive integer in M, this is possible only when r = 0, and m = kd is a multiple of d. Obviously d is the g.c.d. of the numbers in M . It is of interest to connect the properties of moduls with the linear indeterminate equations. We shall use the result expressed in theorem 7-6 to derive the basic theorem 7-3 for equations. Here were given n numbers a\, a,2, . . . , o>n All numbers of the form x = xidi + • • • + x n a n (7-23) with integral x/s will form a modul M, since the sum and difference of two such numbers will be of the same kind. M consists of integers and it is not difficult to find their g.c.d. All numbers a t - belong to M because one can write, for instance, \ ai = lai + 0a 2 + • • • + 0a n But d = (ai, • • • , a«) divides all a/s and consequently all numbers (7-23) so that d is the g.c.d. of the numbers in M. From theorem 7-6 we know LINEAR INDETERMINATE PROBLEMS 161 that M consists of all multiples of d; in particular, d belongs to M so that it is also of the form (7-23) d = x x ai + ■ • • + x n a n with suitable X{. This is the content of theorem 7-3. A set of numbers S is closed under multiplication when the product a • b of any two of its elements a and b is again in S. One concludes that then any finite number of elements in S has a product belonging to S. A set closed under multiplication is sometimes called a ray. Among the examples let us mention: Example 1. The natural numbers as well as the integers. Example 2. The even integers and also the odd integers. Example 3. The rational numbers, the real numbers, and the complex numbers. Example 4. The real numbers between and 1. A system of numbers that is closed under addition, subtraction, and multiplication is called a ring. From theorem 7-5 we see that the specific mention of addition in this definition is superfluous, nevertheless it is usually included in the statement. One can also say that a ring is a modul that is closed under multiplication. Among the many examples are: Example 1. The integers form a ring. Example 2. The even numbers form a ring. Example 3. The rational, real, and complex numbers define rings. Example 4. All complex numbers a + ib, where a and b are integral, form a ring. Example 5. All numbers of the form a + bV2 where a and 6 are integers form a ring. To verify this, we observe that the difference of two such numbers is of the same form, and furthermore (a + bV2) (c + dV2) = ac + 2bd + (be + ad) V2 Example 6. A similar argument shows that for a fixed integer D all numbers a + bx^D with integers a and b form a ring. 162 NUMBER THEORY AND ITS HISTORY We have shown in theorem 7-6 that a modul consisting of integers must consist of all multiples k • a of some number a. It is of interest to note that such a modul is also a ring, since the prod- uct of two such multiples (fcia)(fc 2 a) = (k 1 k 2 a)a is another multiple of a. We turn finally to the sets of numbers that are closed under division. Such a set contains the quotient a/b of any two of its elements, provided b j 6 - 0. Exam-pie 1. The set of positive real numbers is closed under division. Example 2. The set consisting of the single number may be considered to be closed under division. This is somewhat improper of course, since by the definition of such systems the division by was excluded. As a result of the analogy we have already mentioned, between the laws for addition and those for multiplication, one can derive a theorem analogous to theorem 7-5. Theorem 7-7. A set of numbers S, consisting not only of 0, that is closed under division, must have the three properties: (a) S contains 1. (6) When a ^ is in S, so is aT 1 . (c) S is closed with respect to multiplication. Proof: When a 9^ is in S, the quotient a/ a = 1, hence the notien b in S, quotient aT 1 = - must also belong to S. Consequently, for any ah = -37 a is in S. A system that does not include and is closed under division is called a multiplicative group. A simple example is the set of LINEAR INDETERMINATE PROBLEMS 163 all positive and negative powers 1, a, a 2 , ... , aT 1 , a~ 2 , . . . of some number a^O. We now come to the last definition of this kind: A field is a set of numbers that is closed under all four arithmetic opera- tions, addition, subtraction, multiplication, and division. From theorems 7-5 and 7-7, we see that in this definition the inclusion of addition and multiplication is superfluous. One could also have defined a field as a system that is a modul and in which the elements after exclusion of form a multiplicative group. Again we illustrate by some examples: Example 1. The most trivial case of a field would be the number alone. This case is so exceptional that it is ordinarily excluded and not counted as a field. Example 2. The rational, the real, and the complex numbers all form fields. Example 3. All numbers of the form a -f- b^2 with rational a and b form a field. To verify this, one observes that the differ- ence of two such numbers belongs to the set. Furthermore, the reduction a + by/2 _ ac — 2bd be - ad _ c+dy/2 ~ c 2 - 2d 2 + c 2 - 2d 2 V2 shows that the quotient can be written in the same form. Example 4. Clearly the preceding example can be extended. Let D be some fixed, positive or negative integer that is not a square, so that \/D is not rational. As before, one can show that the numbers a + by/D with rational a and b form a field. Such fields are called quadratic fields. There are many other rings and fields, some of great importance in number theory and algebra. For our purposes the examples given above are quite sufficient. We shall conclude these remarks 164 NUMBER THEORY AND ITS HISTORY with a theorem that shows that the rational field in a sense is the smallest possible field: Theorem 7-8. Every field contains the rational field. Proof: From theorem 7-7 one concludes that any field con- tains the number 1. Since the sum of any number of these l's is in the field, all natural numbers are in the field, and so are all integers according to theorem 7-6. Since every rational number is the quotient of integers, our theorem is proved. Problems. 1. Under which arithmetic operations are the following sets of numbers closed : (a) The real numbers ^ 1 (6) The numbers of the form l/« where n is integral (c) The numbers of the form n/2 where n is integral \d) The complex numbers a + ai where a is integral 2. Show that all fractions whose denominators are powers of 2 form a ring. 3. Prove that all numbers of the form a + ° — — with integral a and b form a ring. Bibliography Albert, A. A. : College Algebra, McGraw-Hill Book Company, Inc., New York, 1946. Birkhoff, G., and S. MacLane: A Survey of Modern Algebra, The Macmillan Company, New York, 1941. MacDuffee, C. C. : An Introduction to Abstract Algebra, John Wiley & Sons, Inc., New York, 1940. CHAPTER 8 DIOPHANTINE PROBLEMS 8-1. The Pythagorean triangle. Among the many classical Greek schools of mathematics and philosophy the Pythagorean was the oldest and most venerable. Pythagoras was born around 570 b.c, according to the best estimates. Tradition has it that he came from the island of Samos and traveled widely before he established his school in Crotona in Southern Italy. In Egypt and Babylonia he absorbed the lore of mysticism and also learned the laws of numbers and geometry. Pythagoras must have had considerable personal charm and conviction; his school became a fashionable center and attracted large numbers of students- some as auditors while the more qualified were eligible to be initiated in an inner circle of advanced and mystical learning. The school continued actively for at least a century after the death of Pythagoras, and it preserved its esoteric character as a society of fellows searching for the divine laws of knowledge. The extent of Pythagoras's own creative contributions to the science of mathematics is difficult to estimate, both because his doctrines were propounded only in his lectures and transmitted orally without permanent records, and also because his disciples generally effaced their personal roles by ascribing their discoveries to the founder of the school. The strands of mathematical history are further snarled because later Greek writers almost traditionally ascribed the early mathematical discoveries to the Pythagoreans when their provenance was not otherwise known. The Pythagorean theorem states that in a right triangle the square constructed on the hypotenuse is equal to the sum of the squares on the two legs. When c is the length of the hypotenuse 165 166 NUMBER THEORY AND ITS HISTORY and a and b the lengths of the two other sides, the theorem becomes a 2 + b 2 = c 2 (8-1) This result was certainly known to the Pythagoreans and they may have been the first to give a satisfactory proof. One of the simplest cases of the theorem occurs when the sides are a = 3, & = 4, c = 5 since 32 + 42 = 52 (8 _2) The knowledge of this particular case has been widespread. One finds it in the earliest Chinese and Hindu works, together with other examples where the sides may be represented by integers, for instance, a = 5, b = 12, c = 13 a = 8, b = 15, c = 17 In view of the particular interest of the Pythagoreans in rela- tions that could be expressed in whole numbers, it would appear natural that they should have investigated the problem of finding right triangles with integral sides. There exists, according to Proclus, a much later writer, a formula for a certain type of solu- tion to the equation (8-1), which he ascribes to Pythagoras. The formula is f a = 2n + 1, b = 2n 2 + 2n, c = 2n 2 + 2n + 1 (8-3) where n is any integer. It may be verified by substitution that the values (8-3) actually satisfy the relation (8-1). For n = 1, 2, 3, one finds the following triplets of solutions: (3, 4, 5), (5, 12, 13), (7, 24, 25) and this may be continued to give infinitely many others. Pythag- oras's solution, as one sees, has the special property that the hypotenuse exceeds the larger leg by one. Another special solu- tion is ascribed to Plato. The first general solution of the Pythag- orean problem is found in the tenth book of Euclid's Elements, DIOPHANTINE PROBLEMS 167 shrouded in geometric terms according to the custom of Greek mathematics at the time. Let us examine how one may arrive at the general solution of the equation (8-1) in positive integers. We remark that the restriction to integers is not essential; if any rational solution had been found one could write the three numbers on a common denominator °i 7 h ci a = —■> b = —> c = — m m m and it would follow that 0l 2 + h 2 = Cl 2 would be an integral solution. It is sufficient to find the primitive integral solutions of the equation, i.e., those solutions in which there is no factor common to a, b, and c, because if such a factor did occur the equation could be canceled by d 2 . But for a primitive solution any pair of two of the numbers a, b, and c must be relatively prime. If for instance a and b had a common factor e, the left-hand side in (8-1), and hence also c 2 , would be divisible by e 2 . But then c is divisible by e, contrary to the assumption that the solution was primitive. The next step is to see that in a primitive solution a, b, and c, the numbers a and b cannot both be odd. This is a consequence of theorem 2-1. Since the square of an odd number leaves the remainder 1 when divided by 4, it would follow that if a and b were both odd, the left-hand side in (8-1), hence also c 2 , would leave the remainder 2 when divided by 4, contrary to the theorem just mentioned. We suppose now that the notation is taken such that a is even; consequently b and c are odd since there are no common factors. The equation (8-1) may be written a 2 = c 2 - b 2 = (c + b)(c - b) According to the preceding statements both sides are divisible by 4, and when this factor is divided out, one has r a\ 2 c + b c — b = -H 7T- (8-4) 168 NUMBER THEORY AND ITS HISTORY Here the two integral factors on the right are relatively prime, because any common factor d would divide both the sum and the difference of them. But since c + b c — b c -\- b c — b and b and c are relatively prime, one must have d = 1. When the two numbers on the right in (8-4) are relatively prime, their prime factors are different, and their product cannot be a square unless each of them is a square. We can put, therefore, c + b 9 c — b 9 2 ' 2 and from this we obtain by substitution in (8-4) a = 2uv, b = u 2 — v 2 , c = u 2 + v 2 (8-5) To ensure that this solution is actually primitive, we observe that any common factor of b and c must divide the sum and difference of these numbers. But since c + b = 2u 2 , c - b = 2v 2 and since u and v are relatively prime, the only possible common factor is 2. This factor is excluded when one of the numbers u and v is odd and the other even. From the general primitive solution (8-5) where u and v are integers subject to the conditions just mentioned, one finds the general integral solution of the Pythagorean equation (8-1) by multiplying by an arbitrary integer. The general rational solu- tion is obtained by multiplication of (8-5) by a rational number. A little later on, however, in connection with a problem by Diophantos, we shall need the general rational solution, and it is convenient to have the formulas in a slightly different form. Let DI0PHANT1NE PROBLEMS 169 us divide both sides of a, b, and c in (8-5) by v 2 so that a „ u b /u\ 2 c /u\ 2 -2 = 2-» -a = (-) - 1, - = - + l vr v v l \vj v 2 \vj There exists, therefore, to the given solution (8-5), a proportional rational solution a x = 2t, &! = t 2 - 1, a = t 2 + 1 where we have put t = u/v. When these values are multiplied by some rational number, one obtains the general solution a = 2tr, b = (t 2 - l)r, c - (t 2 + l)r (8-6) where r and t are arbitrary rationals. Some of the primitive integral solutions in the smallest numbers may be obtained from (8-5) . a b c u = 2, » = 1 4 3 5 u = 3, v = 2 12 5 13 u = 4, v = 1 8 15 17 u = 4, » = 3 24 7 25 Extensive tables of integral Pythagorean triangles have been computed; one, for instance, by A. Martin 1 gives all primitive triangles for which the hypotenuse does not exceed 3,000. There are a great number of questions one may ask in regard to the Pythagorean triangles, and through the centuries they have been the source of many number-theory problems. A simple one suggested by the special Pythagorean solution (8-3) is: When does the hypotenuse differ from one of the legs by 1 ? One cannot have c-b = 1 1 Proceedings, Fifth International Mathematical Congress, Cambridge, 1912. 170 NUMBER THEORY AND ITS HISTORY because when the values (8-5) are substituted, one finds the impossible equation in integers 2v 2 = 1 The other possibility c — a — 1 leads to u 2 + v 2 — 2uv = (u — v) 2 = 1 so that u = v + 1. When this is substituted in (8-5), one obtains a = 2v 2 + 2v, b = 2v + 1, c - 2v 2 + 2v + 1 This is, however, the Pythagorean solution (8-3) when the a and b are interchanged in the notation. Other problems have been discussed, for instance, the determina- tion of all integral triangles in which the legs differ by 1, of triangles with special properties of the perimeter or area, of the number of right triangles with a given side, and so on. Problems. 1. Find all integral Pythagorean triangles in which one leg differs from the hypotenuse by 2 or 3. 2. Find all integral Pythagorean triangles with hypotenuse not exceeding 50. 3. Try to find the general solution in integers of the equations (a) 2z 2 +y 2 = z 2 (b) 3x 2 + y 2 = 2 2 by the method used to solve the Pythagorean triangle. 8-2. The Plimpton Library tablet. Our brief sketch of the early history of the Pythagorean problem would have covered the main facts until quite recently. However, in the last decade or two new light has been thrown on the whole beginning of mathe- matics through a deeper understanding of the extent of Babylonian mathematics. The existence of early mathematical results among the Babylonians had long been known or suspected, partly through statements in Greek sources, partly through scattered cuneiform texts. It had also been known that the larger Babylonian collec- DIOPHANTINE PROBLEMS 171 tions, particularly those at the British Museum and the Louvre abroad, and at Yale and the University of Pennsylvania in this country, possessed a considerable number of undeciphered cunei- form tablets of unusual types. They often contained columns of figures, and for that reason they had in some cases been summarily classified as "commercial accounts." Recent investigations, particularly those by Neugebauer and Thureau-Dangin, have revealed that they are actually mathematical tables and texts. With this fact as a key, the reading was not difficult. Through this rich mine of source material we have gained a sur- prisingly intimate view of Babylonian mathematics and its role in society. The tablets cover a period from 2000 B.C. to 200 B.C., but even the oldest ones contain methods that are quite advanced so that the origin of such methods may safely be placed at a con- siderably earlier period. The cuneiform tablets give calculations of areas and volumes, to a large extent as practical problems arising in connection with surveying and construction, digging of dikes, and building of walls. Other problems contain questions regarding the computation of simple and compound interest or division of estates according to rather involved laws and customs. One also finds theoretical problems, some of them strikingly like those given in elementary mathematics today. It is evident that the Babylonians were familiar with problems that led to second- degree equations, and the square roots that occurred in their solution were determined much as they are today, namely, by means of tables. As a whole, Babylonian mathematics made systematic and extensive use of numerical tables. Numerous multiplication tables, tables of inverses, squares, and square roots, tables of powers of a number, tables for finding the circum- ference of a circle, and several other types have been preserved and may be found in the Babylonian collections. Let us dwell for a moment on the tables of inverses, which are particularly common among the Babylonian tablets. The operation of division appears to have been a relatively difficult one to master in the development of arithmetic in all countries. In medieval Europe a man capable of performing long division 172 NUMBER THEORY AND ITS HISTORY was probably more rare than a man with a Ph.D. at present. The simple procedure of successive duplications and mediations, which we described in Chap. 2, has been widely used. The Babylonians used tables of inverses to reduce division to multiplication. To find the value of the fraction a/b, one wrote it as a multiplication a • 1/b where the value of 1/6 could be found as a sexagesimal fraction in the tables. In constructing these tables of sexagesimal inverses, one runs into the same trouble as in the ordinary expansion in decimal fractions, namely, that some expansions are infinite and do not break off, as for instance i = 0.333 • • • , \ = 0.142857 142857 • • • In the most common tables this difficulty is circumvented by including only numbers whose inversions have a finite, in fact, a rather short, sexagesimal expansion. According to Neugebauer the standard type of table of reciprocals usually contains the following pairs : a a- 1 a a' 1 a a" 1 2 30 16 3, 45 45 1, 20 3 20 18 3, 20 48 1, 15 4 15 20 3 50 1,12 5 12 24 2, 30 54 1, 6, 40 6 10 25 2, 24 1 1 8 7, 30 27 2, 13, 20 1, 4 56, 15 9 6, 40 30 2 1, 12 50 10 6 32 1, 52, 30 1, 15 48 12 5 36 1, 40 1, 20 45 15 4 40 1,30 1,21 44, 26, 40 We have preserved the sexagesimal notation in the table. In checking the figures, the reader should recall that the Babylonians used no decimal sign to indicate where the units begin, so that, for instance, 60 may denote not only this figure but also 1 or 60 2 . One observes that in the table, entries like 7, 11, 13, 14, DIOPHA NTINE PROBLEMS 173 and so on, which would give infinite expansions, have been omitted. Although they are comparatively rare, there also exist tables that within their limits give the reciprocals of all numbers without exception. For numbers with an infinite sexagesimal expansion, Fig. 8-1. Ttible of inverses. (Courtesy of Yalu Babul CotlecHon.) one obtains a satisfactory approximation by breaking it off after a certain number of places as in our ordinary numerical tables. The Yale Babylonian Collection, which is particularly rich in mathematical source material, contains one tablet (YBC 10,529) which in its preserved part gives the reciprocals of all numbers between 58 and SO with great accuracy. (Fig. 8-1.) It is not difficult to determine which numbers have a finite sexagesimal expansion b = Go + 60 + 174 NUMBER THEORY AND ITS HISTORY Clearly this can occur only when the fraction can be written in the form an t i - «r (8 " 7) The fraction on the right may be reduced to its lowest terms by cancellation of some factors. Since the base number 60 has the factorization into prime factors 60 = 2 2 • 3 • 5 it follows that in the reduced fraction a/b in (8-7), the denomi- nator b can have only the prime factors 2, 3, and 5. This means that with suitable exponents a, /3, and y, we have b = T • 3* • 5 7 (8-8) Numbers of this type (8-8) may be called regular for the given base number 60. One sees conversely that if b is a regular number, the fraction (8-7) can be extended, and be written in the right- hand form as a fraction whose denominator is a power of 60, and so one finds a finite sexagesimal expansion. The reader may verify that all entries in the table of inverses given above are regular, and also consider the question of finding the length of the expansion when 6 has a given prime fac- torization (8-8). These discoveries in Babylonian mathematics also throw light on the history of early Greek science. The knowledge of Greek mathematics before Euclid has always been somewhat nebulous, and it has been difficult to understand the rapid rise from its primary stages, represented by Thales of Miletus (about 600 b.c.) and the Pythagoreans, to the beautiful system one finds developed at the time of Euclid (300 b.c.) or probably even earlier. It must now be assumed that the Greeks absorbed much more from the Babylonian storehouse of mathematical facts and methods than had hitherto been suspected. This, however, it should be explicitly stated, does not detract from the distinction of the Greeks for having created the concept of the systematic mathe- matical theory as we still understand and use it today, based upon D10PHANTINE PROBLEMS 175 axioms or fundamental assumptions and developed by logical deductions in its proofs. This achievement has been one of the most important in the history of human thought. In the transition from Babylonia to Greece, mathematical knowledge changed its form. Greek mathematics is dominated Fig. 8-2. Plimpton mathematical tablet 'XV2. {Columbia University Library. Courtesy Professor J. Mendelsohn.) by the geometric figure. This preference may in part be due to their feeling for beauty in lines and patterns, as shown in their decorative art and architecture, but a more compelling reason for the adoption of the geometric system was the logical consequence. The geometric lines were understandable and complete, while the numbers led to the logically incomprehensible, the unutterable concept of the irrational. Babylonian mathematics, on the other hand, was arithmetic and algebraic in character and expressed itself through numerical computations. Approximations were resorted to quite freely, thus obviating the necessity for the irrational perfectionism. Judging from the advanced state of Babylonian mathematics 176 NUMBER THEORY AND ITS HISTORY as revealed by the tablets, it seemed a reasonable conjecture that the Babylonians were in possession of the Pythagorean theorem. However, it was not until quite recently that a factual proof was found. In a new publication of cuneiform texts by Neugebauer and Sachs (1945), there is included a description of a clay tablet from the Plimpton Library at Columbia University, which bids fair to be one of the most crucial records in the history of mathe- matics. The tablet, catalogued as Plimpton 322, is composed in Old Babylonian script so that it must fall in the period from 1900 b.c. and 1600 B.C., at least a millenium before the Pythag- oreans. Unfortunately, the tablet is broken and one section is missing, but there remain three complete columns of figures and part of u, fourth which may be reconstructed (see Fig. 8-2). The reader may verify from the photographic reproduction that when we preserve the sexagesimal notation, the numbers in the three columns run as follows: 1, 59 2, 49 1 56, 7 1, 20, 25 [3, 12, 1] 2 1, 16, 41 1, 50, 49 3 3, 31, 49 5, 9, 1 4 1,5 1,37 5 5, 19 8, 1 6 38, 11 59, 1 7 13, 19 20, 49 8 8, 1 [9, 1] 12, 49 9 1, 22, 41 2, 16, 1 10 45 1, 15 11 27, 59 48, 49 12 2, 41 [7, 12, 1] 4, 49 13 29, 31 53, 49 14 58 1, 46 [53] 15 Clearly the last column only enumerates the lines. The first two columns are much more interesting. It is not difficult to verify that they form the hypotenuse and one leg of a Pythagorean triangle. When one squares the numbers in the middle column DI0PHANT1NE PROBLEMS 177 and subtracts from each of them the square of the corresponding number in the first column, one obtains a square number. There are, however, four exceptions to this rule, and in the preceding table the corrected figures have been given rather than the actual figures on the tablet, which have been put in brackets. The exception in line 2 is difficult to explain, while the number 9 instead of 8 in the ninth line must be a mere slip of the stylus. The number in line 13 is the square of the correct one and in line 15 half of the side occurred originally. It is of course some- what unsatisfactory to be compelled to make four corrections in a table with 15 entry lines, but as we shall see, the fourth column gives a further check on the values in the other two columns, con- firming again the corrected figures. It is of interest to compute the missing column of the last side of the triangle ana also to use our previous solution of the Py- thagorean triangle given in (8-5) to determine the values of the numbers u and v that correspond to the solutions on the tablet. This information is given in the following table, which the reader may check: 6 c a u V 119 169 120 12 5 3,367 4,825 3,456 64 27 4,601 6,649 4,800 75 32 12,709 18,541 13,500 125 54 65 97 72 9 4 319 481 360 20 9 2,291 3,541 2,700 54 25 799 1,249 960 32 15 481 769 600 25 12 4,961 8,161 6,480 81 40 45 75 60 2 1 1,679 2,929 2,400 48 25 161 289 240 15 8 1,771 3,229 2,700 50 27 56 106 90 9 5 178 NUMBER THEORY AND ITS HISTORY All solutions are primitive except in line 11, where there is a common factor 15, and line 15, where there is a factor 2. The question naturally arises whether the Babylonians were in possession of a method for solving the Pythagorean triangle corresponding to the general solution we have already established in (8-5). The answer must undoubtedly be in the affirmative, for many reasons. Of course one cannot hope to discover an explicit formula since no algebraic terminology existed at this time. In Babylonian mathematics, as in all early expositions, the reader was expected to infer the general rule from the examples given. Evidently, the large solutions of the Pythagorean problem found in the Plimpton Library tablet have not been obtained by guesswork ; there are many much simpler solutions one would run across before these. The last leg of the triangle, computed in each case from the two given on the tablet, provides the key to the construction of the table. These numbers are all very simple in the sexagesimal system, as the reader may verify by rewriting them, and furthermore they are all regular sexagesimal numbers as we have defined this term, since they have only the prime divisors 2, 3, and 5. According to our solution (8-5), this side is determined by the formula a = 2uv so that u and v are also regular sexagesimal numbers, as one sees by inspection of the table above. Thus it appears that the table on page 176 has been constructed by making a choice of small regular numbers for the parameters u and v. This particular method had been used with a special idea in mind. The numbers representing the side a are all regular and occur in the tables of inverses; this fact points to their application in a division process, and indeed, the last, somewhat maculated, column on the tablet contains the value of the quotient c 2 /a 2 for each triangle. If one denotes by a the angle in the right triangle opposing the side a (see Fig. 8-3), one has c a 2 sin 2 a DIOPHANTINE PROBLEMS 179 Another remarkable fact now becomes apparent. If one proceeds to compute the values of the quotients c 1 - = — = cosec a a sin a it is a consequence of the particular choice of the side a that this trigonometric function must have finite sexagesimal expansions. Furthermore, the values of cosec a. form a very regular sequence with a decrease of almost exactly 1/60 from one line to another, so that one would have a table of this trigonometric function constructed by means of right triangles with integral sides. Cor- respondingly, the angle decreases from 45° to 31°, and it seems natural to believe that there existed companion tablets with similar values for the angles from 0° to 15° and from 16° to 30°. How the Babylonians succeeded in finding values for c and a such that the quotient c/a decreases so evenly cannot be con- sidered fully explained. It is evident, however, that at this early date the Babylonians not only had completely mastered the Py- thagorean problem, but also had used it as the basis for the con- struction of trigonometric tables. One can only hope that future discoveries will produce further material, which will throw light upon this fascinating subject. 8-3. Diophantos of Alexandria. Greek mathematics at its height was preeminently geometric in character. However during the later Alexandrian period, when Greek science and philosophy as a whole was on the decline, and with it mathematics, the alge- braic methods came more into the foreground. It is possible 180 NUMBER THEORY AND ITS HISTORY that this change may have been caused, at least to some degree, by outside influences from Babylon and perhaps even India. During this period, Diophantos (perhaps a.d. 250), the most renowned proponent of Greek algebra, lived in Alexandria. Prac- tically nothing is known about his life. There exists a collection of Greek problems in poetic form, the Palatine Anthology, which was compiled probably not over a century after Diophantos's death. It contains certain simple problems that can be solved by equations, some of them indeterminate, and among them one finds the following, containing all known personal information about Diophantos: Here you see the tomb containing the remains of Diophantos, it is remarkable: artfully it tells the measures of his life. The sixth part of his life God granted him for his youth. After a twelfth more his cheeks were bearded. After an additional seventh he kindled the light of marriage, and in the fifth year he accepted a son. Elas, a dear but unfortunate child, half of his father he was and this was also the span a cruel fate granted it, and he consoled his grief in the remaining four years of his life. By this device of numbers, tell us the extent of his life. If x is the age of Diophantos and if one interprets the poetic statement to mean that the son died at the age when he was half the father's ultimate age, the equation becomes x x , x , „ , x -H h- + 5 + - + 4 = :r. 6 12 7 2 Thus x = 84 was his age. The known titles of works of Diophantos are the Arithmetics in 13 books, the Porisms, and a treatise on polygonal numbers. All of them dealt with the properties of rational or integral numbers. Unfortunately, the Porisms have been lost and only a part of the Polygonal Numbers exists. Six or seven of the books of the Arithmetics have been preserved and there is some doubt whether the whole cycle was ever completed. In regard to the title it should be pointed out that Greek mathematicians used the term arithmetic in the sense of number theory, i.e., the systematic DIOPHANTINE PROBLEMS 181 investigation of the properties of numbers, while ordinary com- putations were classified as logistics. In his mathematical presentation Diophantos uses stenographic abbreviations with special signs, often composed of the initial letters of the names of the concepts he wishes to designate; the unknown quantity, powers, and various operations therefore have fixed notations. This form of mathematical writing has been called syncopated algebra, and it must be considered an early step towards algebraic formalization and the creation of mathematical language. The Arithmetics deal with topics on algebraic equations and more particularly with the solution of certain problems in which it is required to find rational numbers satisfying prescribed condi- tions. More than 130 problems of this latter type, of considerable variety, are discussed, and Diophantos shows great ingenuity in devising elegant methods for their solution. He is particularly adept at selecting the unknowns in such a manner that the alge- braic conditions become easily manageable. We shall reproduce a few of his problems to illustrate the kind of problems he tackles. They should be prefaced by the general remark that negative or zero solutions are always excluded. Problem 1 in Book II requires: To find two numbers such that their sum is in a given proportion to the sum of their squares. In modern notation we would write x 2 + y 2 — T — = V x + y where x and y are the numbers to be found and p the given pro- portion. This may be written x 2 — xp + y 2 — yp = and when it is considered to be a second-degree equation in x, one finds the solutions 2 ±^-y* + py (8-9) 182 NUMBER THEORY AND ITS HISTORY Since the problem should be solved in rational numbers, the number under the square root sign must be a square. A typical device for expressing this condition is based upon the following observation: It is possible to express every number in the form by a suitable choice of the number t. The square number which occurs under the root sign in (8-9) can therefore be written ^ - y 2 + PV = (l + tyj (8-10) When one performs the reduction, the terms that do not involve y drop out, and one factor y may be canceled. There remains a simple equation of the first degree, which gives For any rational value of t, the corresponding y in (8-11) makes the expression (8-10) a square p* [> (i + a - * 2 ) f j-y + w - [a i + ? J When this is substituted in (8-9), one finds for x two solutions * -*>! + ?• X = V ~^TJ (8 " 12) The general solution of the problem is therefore given by (8-11) and (8-12) with rational t. Diophantos, of course, has no for- mulas, but he illustrates the methods for p = 10. His solution x = 12, y = 6 corresponds to t = f . The majority of Diophantos's indeterminate problems require that one shall find certain sets of square or cube numbers with special properties, and the solution of the Pythagorean triangle often comes into play in his procedures. For instance, in Problem. 22 in Book IV it is proposed : To find three numbers such that odp DIOPHANTINE PROBLEMS 183 is the mean proportional between the two others, and such that the difference between any two of them shall be a square number. If x > y > z are the three rational numbers to be found, it is? required that the three differences x — y = a 2 , y — z = b 2 , x - z = c 2 shall be square numbers. To satisfy the first two conditions one must have x = y + a 2 , z = y - b 2 (8-13) with arbitrary a and b, but when these values are substituted in the third it reduces to a 2 + b 2 = c 2 Therefore, the three numbers a, b, and c must form a rational Pythagorean triangle so that according to (8-6) we have a = 2tr, b= (t 2 - l)r, c = (t 2 + l)r (8-14) with rational values t and r. It remains to fulfill the condition that y be the mean proportional between x and z, that is, y 2 = xz According to (8-13) this may be written V 2 = (V + a 2 )(y-b 2 ) and after reduction one finds a 2 b 2 V= ^b 2 From (8-13) follows further x = -5 rs> z = a 2 _ b 2 a 2_ tf To obtain the general solution we must substitute the values (8-14) for a, b, and c. Since the solutions are to be positive, one must choose the sides of the Pythagorean triangle such that a > b. The example on which Diophantos illustrates the pro- 184 NUMBER THEORY AND ITS HISTORY cedure corresponds to the familiar case b = 3, a = 4, c = 5, and he finds „ _ 25G 7 . _ 144 _ SJ, X — 7 , y — 7 , * 7 We shall give a few more examples of problems from the Arithmetics of Diophantos, on which the reader may try his skill. Problem 29, Book II : Find two square numbers such that when one forms their product and adds either of the numbers to it, the result is a square. Problem 7, Book III : Find three numbers such that their sum is a square and the sum of any two of them is a square. Problem 9, Book III: Find three numbers in arithmetic series such that the sum of any two of them is a square. Problem 15, Book III: Find three numbers such that the product of two of them minus the third is always a square. Problem 11, Book IV: Find two numbers such that their sum is equal to the sum of their cubes. Problem 18, Book VI: Find a Pythagorean triangle in which the length of the bisector of one of the acute angles is rational. Quite appropriately, as a tribute to Diophantos's early contri- bution to the subject, algebraic problems in which one is required to find rational solutions are called Diophantine problems. In modern terminology this concept is usually narrowed somewhat to refer mainly to problems with integral solutions. As a conse- quence, even our previous linear indeterminate problems are commonly called linear Diophantine problems in spite of the fact that these problems were not discussed by Diophantos, probably because he considered them trivial. For instance any linear equation with integral coefficients may be solved rationally by giving arbitrary rational values to all unknowns except one and expressing the remaining one by the others. It seems unlikely that the large collection of problems in the Arithmetics should be the creation of a single author, and some of them must have been gleaned from previous sources. However, any statements about iae earlier history of Diophantine problems are entirely conjectural. It is possible that Greek algebra was DIOPHANTINE PROBLEMS 185 further developed than our present sources indicate, and it is always an open guess that Babylonian mathematics embraced problems of this type. 8-4. Al-Karkhi and Leonardo Pisano. To the subsequent Greek mathematicians, all of them of very minor stature, and to the Arabs, Diophantos remained an outstanding name, almost synonymous with algebra itself. Among the Arab mathemati- cians, al-Karkhi of Bagdad, who died around a.d. 1030, was probably the most scholarly and original. Two of his works are known. One is the Al-Kafi fit hisab or Essentials of Arithmetic which is of an elementary character and gives the rules for com- putations. It is peculiar in that it avoids the use of Hindu numerals throughout, although they were at this time quite common in Bagdad. Among certain orthodox groups among the Arabs there seems to have been strong objection to the Hindu numbers, in many ways reminiscent of the opposition of the abacists in Europe to the same numbers a few centuries later. Al-Karkhi's second work, the Al-Fakhri, is a much more important document in the history of mathematics. It derives its name from al-Karkhi's friend, the grand vizier in Bagdad at the time, to whom the treatise was dedicated. Al-Karkhi, in many ways, was the Arabic successor to Diophantos, even to the extent that the Al-Fakhri contains long sections that have been copied verbatim from the Arithmetics. The general plan of the two works is the same. Both contain basic algebraic theory with applications to equations and especially to problems that should be s;lved in rational numbers. Although al-Karkhi repeats many of Diophantos's problems, he develops the methods further and also introduces problems of quite different types. However, in terms of our present-day algebraic symbolism, most of them do not present great difficulties. For instance, in Problem 1 in Section 5 in the Al-Fakhri it is requested to find such numbers that the sum of their cubes is a square number. This means that the equation x B + y 3 = z 2 186 NUMBER THEORY AND ITS HISTORY shall be solved in rational numbers. One can put y = mx, z = nx and by substitution and cancellation of x 2 , one obtains n 2 x = 1 +ra d where m and n may be arbitrary rational numbers. Al-Karkhi gives the special solution x = 1, y = 2, z = 3, a set of numbers that probably led to the problem's being put. The same method is clearly applicable to much more general rational problems, for instance, ax n + by n = cz n ~ l and others for which al-Karkhi gives illustrations. In several problems he asks for rational solutions to two simul- taneous equations that may be included in the general type x 3 + ax 2 = y 2 , x 3 — bx 2 = z 2 where a and b are known integers. Again al-Karkhi puts y = mx, z = nx and from the two equations he derives x = m 2 — a, x = n 2 + 6 Since these two numbers must be the same, the condition m 2 — n 2 = a + b must be satisfied for m and n. Here one puts m = n + t and obtains 2nt + t 2 = a + b or a + b - t 2 n = 2t From this value one finds m and in turn the general solution for x, y, and z in terms of the arbitrary rational number t. Al-Karkhi, DIOPHANTINE PROBLEMS 187 of course, only gives examples, for instance x 3 + 4x 2 = y 2 , x 3 - hx 2 = z 2 is found to have the solution x = 21. In regard to mathematical knowledge the Middle Ages in Europe was a vacuous period with a single, brilliant star, Leonardo Pisano. Leonardo was a mathematician of great originality and creative power but also a direct successor to the Arabic mathe- matical school, much in the way al-Karkhi was heir to the knowl- edge and inspiration of Diophantos. Leonardo never mentions his sources, but he was educated in North Africa and traveled widely in the Eastern Mediterranean, and there can be no question that he was familiar with works of the leading Arabic mathematical writers. In Leonardo's main work, the Liber abaci (1202), one finds many problems that have been borrowed literally from the Al-Fakhri, and therefore sometimes originally from Diophantos; others have their source in al-Khowarizmi's Al-Jabr wal- Muqabalah. Leonardo's fame was widespread, and true to the customs of the time, he was presented with challenge problems from near and far. Some of these were indeterminate problems. For instance, Master Theodorus, court philosopher to Emperor Frederic II proposed the problem of finding numbers x, y, and z such that all three expressions x + y + z + x 2 , x + y + z + x 2 + y 2 , x + y + z + x 2 + y 2 + z 2 become squares. This was a problem truly in the tradition of Diophantos, and Leonardo gives as one solution r _ JJ8. 7/ _ .48 „ _ 144 The Emperor Frederic II was a sincere patron of learning and actively promoted the diffusion of Arabic knowledge in Europe. No wonder therefore that he took an interest in such an out- standing scholar as Leonardo. Probably in the year 1224, he 188 NUMBER THEORY AND ITS HISTORY was summoned to take part in a mathematical tournament, which was to be held in the presence of the emperor. The prob- lems were formulated and presented by John of Palermo, another scholar belonging to the entourage of the emperor. Leonardo easily carried off the laurels by solving all problems in the most admirable manner. One of the problems was the solution of a particular cubic equation, and after having shown that there could be no rational root to it, Leonardo proceeded to compute the real root in sexa- gesimal fractions with an accuracy that corresponds to 11 decimal places. A much simpler problem was the following, which we mention only because it belongs to a type that at the time enjoyed considerable popularity : Three men own a share in a heap of coins; the first owns §, the second §, and the third f of the total. The money is divided by having each man take an amount arbitrarily. The first man afterwards returns \ of the coins he has taken, the second \, and the third \ . The money thus returned is divided into three equal shares, which are given to each man, and it turns out that now everyone has his proper part. How much money was there, and how much money did each obtain the first time? We leave the solution to the reader. Here we are more interested in the following indeterminate problem proposed in the tournament: Find such a square number that when 5 is added or subtracted one also obtains squares. In mathematical symbols, one wishes to find a number x such that a* + 5 = y 2 } x 2 - 5 = z 2 (8-15) Leonardo gives the solution x = 3 j^-. Again one cannot exclude the possibility that Leonardo may have been familiar with this kind of problem since it occurs in earlier Arab writings. However, in a treatise Liber quadratorum (1225) written shortly after the tournament, Leonardo returns to the problem and here his methods are entirely different from those used by Arab mathematicians. Let us discuss the general problem of rinding a square number DIOPHANTINE PROBLEMS 189 such that when a given number h is added to it or subtracted from it one obtains other square numbers. This means that we must find a number x such that simultaneously x 2 + h = a 2 , x 2 - h = b 2 (8-16) and determine for which h rational solutions x can exist. We shall first determine the solutions in integers and this depends, as we shall see again, on the Pythagorean triangle. When the second equation (8-16) is subtracted from the first, one has 2h = a 2 - b 2 = (a - b)(a + b) (8-17) Since the left-hand side is even, a and b must both be odd or both even. Therefore, a — b is even a - b = 2k and k must be a divisor of h, according to (8-17). It follows that and by adding and subtracting the last two equations, one finds a = — - -\- k, b = — — k 2k ' 2k When these two expressions are substituted in the original equa- tions (8-16), there results so that we have now only a single condition 2 + k 2 \2k) 190 NUMBER THEORY AND ITS HISTORY Therefore the three numbers * i. form a Pythagorean triangle, and according to the solution we have obtained, we can write h x = t(m? + n 2 ), — = t(m 2 - n 2 ), k = 2mnt where t is some integer and the expressions in m and n define a primitive solution of the triangle. When we take the product of the last two expressions, we obtain as the general solu- tion to (8-16) x = t{m 2 + n 2 ), h = 4mn(m 2 - n 2 )t 2 (8-18) We shall make a slight reduction in this solution. Let us suppose that we have a solution x of (8-16), where x has the factor t and h at the same time the factor t 2 x = x\t, h = hit 2 From the two equations xft 2 + h x t 2 = a 2 , x x H 2 - ht 2 = b 2 (8-19) it follows that a and b have the factor t a = a\t, b = b\t After the factor t 2 has been canceled in (8-19), one has %i 2 + hi = a 2 , x 2 — hi = bi 2 When no further such reduction is possible, we shall say that we have a primitive solution. When this reduction is applied to (8-18), the solution becomes x = m 2 + n 2 , h = 4mn(m 2 — n 2 ) (8-20) The numbers m and n produce a Pythagorean triangle where sides have no common factor. The hypotenuse x is then relatively prime to the sides DIOPHANTINE PROBLEMS 191 hence x is relatively prime to h, and (8-20) must be a primitive solution to the problem in the sense just denned. When one takes small values for m and n, one finds the following primitive solutions: m n h X 2 1 24 5 3 1 96 10 3 2 120 13 4 1 240 17 4 3 336 25 When the equations (8-16) in our problem are to have integral solutions, the number h must have the form we have derived in (8-18). However, to determine when a given number h can be represented in this manner is in itself a problem that is not easily settled in general. After Leonardo, many mathematicians returned to the problem and the permissible numbers even received a special name, a congruum. This nomenclature is now obsolete and must not be confused with the congruent numbers we shall study in the next chapter. Leonardo established the following simple property: A congruum is divisible by 24. In the examples given above in the table this is immediately verified. To prove it in general, we recall that of the numbers m and n that give a primitive solution to a Pythag- orean triangle, one is odd and the other is even. The product mn is therefore divisible by 2, and so h is divisible by 8 according to (8-20). It remains to show that h is divisible by 3. This is immediate when m or n is divisible by 3. W T hen neither of them is divisible by 3, one can write so that m = 3mi ±1, n = Zni ± 1 m 2 - n 2 = 9wi 2 - 9n x 2 ± Qm 1 ± 6^ is divisible by 3. 192 NUMBER THEORY AND ITS HISTORY It is now time to return to the original tournament problem (8-15) solved by Leonardo. Since in this case h = 5 is not divisible by 24, there can be no integral solutions. We therefore write x, a, and b as fractions with a common denominator x x a x fc _£ x — — ' a = — - > d d d By substitution into (8-15) and clearing the fractions, one obtains x * + 5d 2 = a, 2 , x x 2 - 5d 2 = h 2 (8-21) If there is to be any solution to (8-15) in rational numbers, it must be possible to find some integer d such that bd 2 is a congruum. Now in the condition 5d 2 = 4mn(m 2 — n 2 ) it is a natural first attempt to make m = 5, and one must then satisfy d 2 = 4n(5 2 - n 2 ) By trying out the first few integers, one sees that n = 4 gives a square d 2= 4-4(5 2 - 4 2 ) = 144 = 12 2 The values n = 4, m = 5, according to (8-20), result in the solution Xl = 5 2 + 4 2 = 41 for (8-21). Consequently xi 41 „ 5 x = — = — = 3 — d 12 12 is a solution to Leonardo's problem, as he actually stated. To check the solution we have «v + 5 = n 2 , /«v - 5 - (^Y 12/ \12/ \12/ \12/ DIOPHANTINE PROBLEMS 193 There are no indications that John of Palermo was himself a prominent mathematician. On the other hand, when we look back upon the process that was required for the solution of his last problem, it is evident that it was not proposed haphazardly. It is difficult to escape the conclusion that it was a problem drawn from previous sources, and in that case most naturally from Arabic scholars whom he encountered on his native Sicily, which under Frederic II was one of the centers in the exchange of Euro- pean and Oriental scholarship. We have followed the development of Diophantine analysis through the Arabs to its transmittal to Europe through Leonardo Pisano. There exists, however, another branch of this field of number theory, which we must mention although we shall not pursue it in detail. The Hindus early became acquainted with the works of Diophantos, but their own number theory took an independent direction. We have already mentioned (Sec. 6-2) the method of the pulverizer, a variation of the algorism of Euclid, which gave the Hindus the solution of their linear indeterminate problems. But both in the Brahma- Sputa- Siddhanta by Brahmagupta and the Bija-Ganita by Bhaskara, one finds con- siderable space devoted to indeterminate problems of the type ex 2 + 1 = y 2 and more generally ex 2 + a = y 2 Not only are the rational solutions found; the integral solutions are also discussed. Later it has turned out that this kind of problem is of systematic importance for various mathematical questions, for instance, for continued fractions and number theory in quadratic fields, both subjects that are left out of this book with regret. Problems. The reader may try to find the rational solutions to the following equations or sets of equations, all taken from the Al-Fakhri: 1. x 2 + 5 = y 2 3. x 2 - 2x - 2 = y 2 2. x 2 - 10 = y 2 4. 10 - x 2 = y 194 NUMBER THEORY AND ITS HISTORY 5. lOx - 8 - x 2 - y 2 9. x 4 + y* = z z 6. x 2 + x = y 2 , x 2 + 1 = 3 2 10. x 2 - y 3 = 2* 7. x 3 + y S = 2 2 1L x 6 + 5y 2 = 3 2 8. xV = z 3 8-5. From Diophantos to Fennat. Fermat represents a focal point in the history of number theory; in his work the radiating branches of earlier periods were united and their content recreated in a richer and more systematic form. The path from Diophantos to Fermat, although long in time, is quite direct. During the Renaissance, at the rebirth of classical learning, numerous manuscripts of Greek mathematical works reached Western Europe. The general level of mathematics in Europe had been extremely low during the Middle Ages, so low that the Greek knowledge was a revelation whose true content at times was found to be intolerably hard to decipher. Among the works were copies of the writing of Diophantos, whose very name had until then been unknown, and they represented a severe challenge to the mathematicians of the sixteenth century. The first reference to Diophantos in the Occident seems to have been made by Regiomontanus in 1462. He reported that he had discovered a manuscript of a certain Diophantos in the Vatican library and that he was interested in making a translation from the Greek, a task he never seems to have tackled. The first printed edition and translation of Diophantos into Latin was published in Heidelberg in 1575, by the German pro- fessor Holzman, a name which he changed to the Greek form Xylander. To show the impact of Greek mathematics on the European scholars, let us reproduce a part of Xylander's foreword to his translation of the Arithmetics. He mentions that he had heard earlier of the existence of a Diophantos manuscript, but . . . since no one had edited it, I gradually silenced my eagerness to know it, and buried myself in the mastery of the works of such arithme- ticians as I could obtain, and in my own cogitations on the subject. Truth however compels me to offer with complete frankness the testi- DIOPHANTINE PROBLEMS 195 mony which follows, however much to my disgrace. As for Cossica or Algebra, since, self-taught — except for the mute teachings of books, I had not only acquired command of the subject, but also had advanced to the point of adding, giving variety, and in places even of making corrections to what such great and devoted teachers as Christifer Rodolphus Silesius, Michaelus Stifelius, Cardanus, Nonius, and others had written about it, I fell into that mood of complacency, which Heraclitus called "The Holy malady"; — in short I came to believe that in Arithmetic and Logistic "I was somebody". And in fact by not a few, and among them some true scholars, I was adjudged an Arithme- tician beyond the common order. But when I first came upon the work of Diophantos, his method and reasoning so overwhelmed me that I scarcely knew whether to think of my former self with pity or with laughter. It has seemed w orth while in this place to proclaim my former state of ignorance, and at the same time to give some hint of the work of Diophantos, which swept away from my befogged eyes the cloud of darkness which enveloped them. The treatment of surds I had mastered so well that I had even ventured to add to the inventive- ness of others some things not inconsiderable, and these contributions in the field of arithmetic were accounted of no small importance in view of the difficulties of the subject, which had driven many from the whole subject of mathematics. But how much more brilliant a performance was it, in problems which seemed scarcely capable of solution even with the help of surds, and where surds bidden to till the soil of Arithmetic, true to their name, turned a deaf ear and fahed, to carry the solution of the subtlest kind of problems to a point where surds are not invoked, and are not so much as even mentioned. Xylander emphasizes with admiration how Diophantos is able to avoid irrational square roots or surds in his solutions. He puns, as one sees, on the surd or deaf numbers, a term we have taken over as a direct translation from Arab authors. This is in direct analogy with the "unspeakable" numbers of the Pythagoreans, and it is fully as satisfactory as our "irrational" roots, translated from the Greek a\oyos or without ratio. Another ancient term in Xylander is the Cossica or Rule of Coss, which in early English texts most often appears as the Cossick Art, synonymous with algebra or equation theory. It refers to the common terminology 196 NUMBER THEORY AND ITS HISTORY of the time, of Italian origin, in which the unknown to be found in a problem is termed the thing or cosa. Xylander's source manuscript was quite unsatisfactory and this is reflected in his translation. Nevertheless, the book created much interest in problems of Diophantos's type. In 1621 Bachet de Meziriac, whose acquaintance we have already made in connec- tion with the linear indeterminate problems, published a new edition with notes and comments. In some of these he sharply and somewhat ungratefully criticizes Xylander, whose earlier edition clearly had been of assistance to him. However, Bachet's edition represents a great improvement. Furthermore, it is very probable that it has the unique distinction of being the work that introduced Fermat to the problems of number theory. Fermat possessed a well-worn copy of Bachet's Diophantos, which he also used as a notebook. In the margin he jotted down several of his most important results as they occurred to him in connection with the related problems in Diophantos. After Fermat's death the entire book, together with Fermat's notes, was published by his son Samuel (1670). We shall discuss the content of a few of the various results indicated by Fermat in his marginal comments to Diophantos. Here one finds the result we have already mentioned in connection with the factorization of numbers, and which we prove in Chap. 11, namely, that every prime of the form 4n + 1 can be represented as a sum of two integral squares in a single manner. By means of the identity (a 2 + b 2 ) (c 2 + d 2 ) = (ac ± bd) 2 + (ad^F be) 2 (8-22) which was known to Leonardo Pisano and was used implicitly by Diophantos, one can represent the product of any two numbers that are sums of two squares as the sum of two other squares, and even in two different ways. We have, for instance, 13 = 3 2 + 2 2 , 37 = 6 2 + l 2 and find by using (8-22) 13 • 37 - 20 2 + 9 2 = 16 2 + 15 2 DIOPHANTINE PROBLEMS 197 In the special case 2 = l 2 + l 2 one derives from (8-22) 2(a 2 + b 2 ) = (a + 6) 2 + (6 - a) 2 One concludes, therefore, that any product whose factors are 2 and primes of the form An + 1, can be represented as the sum of two squares. Moreover, if one multiplies a sum of two squares by a square number P(a 2 + 6 2 ) = {ka) 2 + (kb) 2 the result is a sum of two squares. This leads to the criterion: If N is an integer and n 2 its largest square factor, so that N = N n 2 then N is the sum of two squares if the prime factors of N are 2 and primes of the form 4n + 1. Conversely, it may be shown that these are the only numbers that are the sum of two squares. Fermat also gives a formula for the number of such representa- tions. We shall return to these questions in Chap. 11. Examples. 1. The two numbers 56 = 7 • 2 3 , 99 = 3 2 • 11 cannot be the sum of two squares since the prime factors 7 and 11 are not of the form 4n + 1. 2. The number 1,105 = 5 • 13 • 17 can be represented as the sum of two squares. To find the representations we observe that 5 = 2 2 + l 2 , 13 = 3 2 + 2 2 , 17 = 4 2 + l 2 By application of the identity (8-22) one obtains 5 • 13 = 8 2 + l 2 = 7 2 + 4 2 5 • 17 = 9 2 + 2 2 = 7 2 + 6 2 13 • 17 = 14 2 + 5 2 = ll 2 + 10 2 198 NUMBER THEORY AND ITS HISTORY and by a repeated application one finds the four representations 1,105 = 33 2 + 4 2 = 32 2 + 9 2 = 31 2 + 12 2 = 24 2 + 23 2 One verifies that there are no others. Problem. Which of the numbers 101, 234, 365, 1,947 can be written as the sum of two squares? Not all numbers are the sum of two squares, as we just observed. Some, but not all, of the others, can be written as the sum of three squares. For instance, the prime 43 is not the sum of two squares, but one has 43 = 5 2 + 3 2 + 3 2 Similarly, not all integers are the sum of three squares, for instance, the prime 47 is not so representable, as one easily verifies, but it is the sum of four squares, even in two ways 47 = 6 2 + 3 2 + l 2 + l 2 = 5 2 + 3 2 + 3 2 + 2 2 Bachet made the conjecture that every positive integer can be written as the sum of at most four squares, and he verifies it for all numbers up to 120. Fermat states in one of the Diophantos notes that he has a proof for this theorem. In a letter to the French mathematician Roberval he returns to the difficulties he had to overcome to find a proof and explains that he had finally succeeded through the use of his favorite method of infinite descent, a procedure he also had used to derive the results regarding the representation of numbers as the sum of two squares. He con- tinues: "I confess openly that in the theory of numbers I have found nothing which I have enjoyed more than the proof of this theorem and I should be pleased if you would attempt to find it, even if it were only to let me know whether I value my discovery higher than it deserves." There seems to be little reason to doubt that Fermat was in possession of a proof according to the indications he has given. That the problem was difficult can be judged from the fact that even the resourceful Euler in vain pitted his ingenuity against it, DlOPHANTINE PROBLEMS 199 and not until 1770 did the French mathematician J. L. Lagrange, the successor of Euler at the Academy in Berlin and later a friend of Napoleon, publish the first proof. As so often happens, the completion of one problem gives birth to another. In the same year Edward Waring (1734-1798), professor in Cambridge and both scientifically and personally one of England's most peculiar mathematicians, published his Meditationes algebraicae. In this work one finds several announcements and conjectures on the theory of numbers, among them the fact that every number can be represented as the sum of a limited number of cubes, fourth, or higher powers. This Waring's problem has occupied the mathematicians intensely. That such representa- tions exist was proved by the German mathematician D. Hilbert in 1909. Essential information regarding the number of powers that are required in each case has been given by various mathe- maticians; among the most important results, one should mention particularly those of the English mathematicians G. H. Hardy and J. E. Littlewood, Vinogradoff (Russian), and L. E. Dickson of the University of Chicago. 8-6. The method of infinite descent. Fermat's method of the descente infinie is illustrated by his comments on Problem 26 in Book VI in Diophantos's Arithmetics. These remarks are inter- esting in several ways. He begins by stating: "The area of a rational right triangle cannot be a square number. The proof of this theorem I have reached only after elaborate and ardent study. I reproduce the proof here, since this kind of demonstration will make possible wonderful progress in number theory." Then follows a fairly complex indication of the proof and it is remarkable that in the long statement he uses no mathematical symbolism whatever, giving all terms in longhand words. Towards the end he breaks off with the statement: "The margin is insufficient to give all details of the proof." We shall give the proof in ordinary algebraic symbols, but we first reduce the problem to integers by the following observations. When the area of a rational triangle is a square number and each side is multiplied or divided by a factor, the area is multiplied 200 NUMBER THEORY AND ITS HISTORY or divided by the square of this factor and it remains a square number. One can therefore clear the fractions in the rational sides to make them integral, and if they now should have any common divisor, it may be canceled. It follows that it is sufficient to show that the area of an integral, primitive Pythagorean triangle cannot be a square number. The proof of this theorem is a bit long, but each step, as will be seen, is quite simple. The sides of a primitive Pythagorean triangle a = 2mn, b = m 2 — n 2 , c = m 2 + n 2 (8-23) we have already found. The area of the triangle is A = §a& = mn(m 2 - n 2 ) (8-24) Since this integer shall be a square, one must have mn(m — ri)(m -\- n) = t 2 (8-25) In a primitive triangle the numbers m and n are relatively prime, one even and the other odd, and one concludes, therefore, that among the four numbers m, n, m — n, m + n any two are relatively prime. Since their product is a square, according to (8-25), each one of them is a square m = u 2 , n = v 2 , u 2 — v 2 = p 2 , u 2 + v 2 = q 2 (8-26) where all four numbers u, v, p, q, also must be relatively prime in pairs. By adding and subtracting the last two equations in (8-26), one finds 2u 2 = p 2 + q 2 , 2v 2 = q 2 - p 2 = (q - p) (q + p) (8-27) Since one of the numbers m and n is odd and the other even, u and v must have the same property, so that according to (8-26) p and q must both be odd. This shows further that q — p and q + p are both even so that the second equality in (8-27) yields that v is even v = 2v\ DIOPHANTINE PROBLEMS 201 We put this into the second equation in (8-27) and find 2vi = — - — * — ~ — 2 2 (8-28) q — p q -\- p Here the two factors — - — and — — — on the right are relatively z z prime, because a common factor would divide their sum q and their difference p, but p and q are relatively prime. In (8-28) we have two alternatives, depending on which of Q ~ V the factors on the right is even. Let us suppose that — - — is even. Then, besides the factor 2 it must have some factor in it! factor of wi 2 , so that we can write common with v 2 , while — - — must be equal to the remaining l^v = 2k2 <L±JP = l 2 (8 _ 29) 2 2 where v x 2 = k 2 l 2 (8-30) The other alternative is that — - — is even, and in this case one Zi obtains similarly " "" n = I 2 , ^—^- = 2k 2 (8-31) Q-P 12 ? + P_oi2 where (8-30) still holds. From (8-29) one finds p = l 2 - 2k 2 , q = l 2 + 2k 2 and, in the alternative case (8-31), p = 2k 2 - I 2 , q = 2k 2 + I 2 When these values for p and q are substituted in the first equation (8-27), one finds in both cases w 2 = ( Z 2 )2 + Qk 2 ) 2 (8-32) 202 NUMBER THEORY AND ITS HISTORY We have now completed the steps preparatory to the use of the infinite-descent argument. Our starting point was the integral Pythagorean triangle (8-23) with an area (8-24) which was supposed to be an integral square number. From this we have, according to (8-32), derived a new triangle of the same kind with the sides I 2 , 2k 2 , u The area of the new triangle is found to be A 1 = ^ -l 2 -2k 2 = l 2 k 2 = v, 2 = (^ = - 4 so that it is also an integral square number, which clearly is smaller than the area of the original triangle. From this second triangle one could derive a third, a fourth, and so on, with the same prop- erties and steadily decreasing integral areas. This, however, clearly involves a contradiction since the area is always an integer St 1. Our initial assumption that there existed some Pythagorean triangle with a square number for its area is therefore inaccept- able, and the theorem is proved. In general, the method of infinite descent may be stated in the following form: it is assumed that a problem can be solved in positive integers and one derives from this a new solution in smaller numbers; since positive integers cannot be decreased indefinitely, one arrives at a contradictory situation so that the assumption that the problem had a solution is impossible. There are various consequences of the result that the area of a Pythagorean triangle cannot be square. Let us return for a moment to the concept of a congruum, which was introduced in connection with the problem of Leonardo. The expression (8-20) for a congruum was h = Amn{m 2 — n 2 ) and when one compares it with the expression (8-24) for the area of a Pythagorean triangle, one sees that the congruum is four times the area of the triangle defined by m and n. We can state therefore: A congruum cannot be a square number. Leonardo DIOPHANTINE PROBLEMS 203 was aware of this result in his Liber quadratorum, but he did not possess any satisfactory proof for it. Another consequence is: There are no fourth powers whose difference is a square; i.e., the equation x 4 _ ^4 = z 2 (8 _ 33) has no solution in integers x, y, and z different from zero. If one could find two such integers x and y fulfilling the equation (8-33), the Pythagorean triangle defined by m = x 2 , n = y 2 would, according to (8-24), have the area x 2 y 2 (x 4 — y 4 ) = x 2 y 2 z 2 which is a square. 8-7. Fermat's last theorem. We now come to the most famous of Fermat's remarks in his copy of Diophantos. In Problem 8 in Book II Diophantos propounds: To decompose a given square number into the sum of two squares. To use a general notation, let a 2 be the given square for which one wants to find x and y such that a 2 = x 2 + y 2 (8-34) As usual, Diophantos asks for rational solutions. For a suitably chosen number m, one can then write y — mx — a When this is substituted into (8-34), one can cancel a factor x and find 2am x = + 1 Here m may be any rational number. Diophantos must proceed only by illustrating the method on an example. He chooses a = 4 and takes a solution that corresponds to m = 2 in our formula, giving x — 5 > y 5 One verifies that (¥) 2 + (W 2 = 4 2 204 NUMBER THEORY AND ITS HISTORY This problem to us is quite straightforward, but it was not always so. In the oldest preserved Diophantos manuscript, copied in the thirteenth century, we find at this point the following heartfelt remark by the writer: "Thy soul, Diophantos, to Satanas, for the difficulty of thy problems and this one in particular." Fermat's comments in connection with this problem are, as one should expect, considerably more constructive and of much Fig, 8-4. Pierre de Fermat (1608-1665). greater consequence: "However, it is impossible to write a cube as the sum of two cubes, a fourth power as the sum of two fourth powers and in general any power beyond the second as the sum of two similar powers. For this I have discovered a truly wonder- ful proof, but the margin is too small to contain it." This is the famous Fermat's theorem, sometimes called Fermat's last theorem, on which the most prominent mathematicians have tried their skill ever since its announcement three hundred years ago. In algebraic language, it requires that it shall be shown that the Diophantine equation x n +y n = z n (8-35) DIOPHANTINE PROBLEMS 205 has no solution in integers x, y, and z, all different from zero, when n ^ 3. For one case of the theorem Fermat obviously had a proof. It follows from our previous results that the equation x ± + y* = S 4 (8 _ 36 ) cannot have any integral solutions different from zero. One can write this equation in the form 2 4 _ y 4 = (a .2 )2 and since we have shown that the difference between two fourth powers cannot be a square, (8-36) is also impossible in integers. This result also goes a little further. If the exponent n in (8-35) is divisible by 4, one can write n = 4ra, and Fermat's equation takes the form (x w ) 4 + {y m f = (z m ) 4 and this equation is impossible as we have just shown. By a similar remark one can reduce the general case to the case where the exponent in (8-35) is an odd prime. Let us suppose that n = pm where p > 2 is a prime. Then Fermat's equation may be written (x m ) p + (y m ) p = (z m ) p so that it is sufficient to prove the equation impossible for prime exponents p > 2. The question whether Fermat possessed a demonstration of his last problem will in all likelihood forever remain an enigma. Fermat undoubtedly had one of the most powerful minds ever applied to investigate the laws of numbers, and from his indica- tions there is every reason to believe that he was able to prove the various other assertions that he included in the Diophantos notes. The remark that the margin was too small may perhaps sound a bit like an excuse, but it was an observation he had to make also in other instances. On the other hand, he may have made a mistake, as in another case, where the conjecture, which he repeated in several letters, that all Fermat numbers were primes proved incorrect. Mathematicians occasionally may argue the point; the 206 NUMBER THEORY AND ITS HISTORY consensus seems to be that in view of the numerous investigations of the problem for three centuries from every conceivable angle, by first- and second-rate mathematicians, by amateurs and dilettanti, it is very unlikely that there should exist a proof based on any methods one can reasonably assume Fermat could have mastered. Such methods would undoubtedly have great conse- quences in other problems of number theory, but Fermat mentions them nowhere. Like so many of the other mathematicians who later worked on the problem, including Kummer whose results were the most incisive of all, he may have fallen into one of the many pitfalls of insufficient reasoning that have beset the investi- gations on the problem. Fermat's problem has remained remarkably active throughout its history, and results and research on it still appear frequently in the mathematical journals. It must be admitted frankly that if the specific result implied in the theorem were obtained, it would probably have little systematic significance for the general prog- ress of mathematics. However, the theorem has been extremely important as a goal and a constant source of new efforts. Some of the new methods it has inspired have proved to be basic not only for number theory but also for many other branches of mathematics. As we mentioned, Fermat gave a proof of his theorem when n = 4. The case n = 3 he presented repeatedly as a challenge problem to French and English mathematicians, and it seems unlikely that he should propose a problem to which he could not himself give an answer, if requested. The first proof for the cubic case was published by Euler in a French translation of his Algebra. The case n = 5 was proved independently about 1825 by the German mathematician Lejeune-Dirichlet and the French Legendre, and the case n = 7 in 1839 by Lame. The most significant advance in the investigations of the prob- lem was made by the German mathematician E. Kummer (1810- 1893). He extended the domain of number theory to include not only the rational numbers but also the algebraic numbers, i.e., numbers satisfying algebraic equations with rational coefficients. DIOPHANTINE PROBLEMS 207 In 1843 Kummer submitted to Lejeune-Dirichlet a manuscript containing a purported proof of Fermat's theorem based on algebraic numbers. Dirichlet, who had made similar attempts himself, immediately picked out the error in the reasoning: in the domain of algebraic numbers the fundamental theorem no longer holds that every number is representable essentially in one way as a product of prime factors. This failure caused Kummer to attack the problem with redoubled vigor, and a few years later he succeeded in finding a substitute for the theorem of the unique factorization in the theory of ideals, a theory that later has gained importance in almost all parts of mathematics. By means of the ideals, Kummer was able to derive very general conditions for the insolubility of Fermat's theorem. Practically all important progress in this field in the last century has been made along the lines suggested by the theory of Kummer. Numer- ous criteria have been developed by means of which Fermat's equation has been proved impossible for all exponents at least up to n = 600. A curious twist was added to the history of Fermat's problem in 1908 when the German mathematician P. Wolfskehl, who had made a few contributions related to the subject, bequeathed 100,000 marks to the Academy of Science in Gottingen for a prize to be awarded for the first complete proof of Fermat's last theorem. The prize probably added little or nothing to the interest of the mathematicians in the problem, but an immediate consequence was a deluge of alleged proofs by laymen eager to gain money and glory. This interest of the dilettanti in the problem has since never quite ceased, and Fermat's problem has without question the distinction of being the mathematical problem for which the greatest number of incorrect proofs have been published. (See Supplement.) Bibliography Bonconpagni, B.: Scritti di Leonardo Pisano, matematico del secolo decimo terza, Rome, 1857-1862. Carmichael, R. D.: Diophantine Analysis, John Wiley & Sons, Inc., New York, 1915 208 NUMBER THEORY AND ITS HISTORY Colebrook, H. T. : Algebra with Arithmetic and Mensuration from the Sanscrit of Brahmegupta and Bhascara, London, 1817. Fermat, P.: Oeuvres, publiees par les soins de M. M. Paul Tannery et Charles Henry, 4 vols , Paris, 1891-1912. Heath, T. L. : Diophantos of Alexandria; A Study in the History of Greek Algebra, second edition, with a supplement containing an account of Fermat's theorems and problems connected with Diophantine problems by Euler, Cambridge University Press, London, 1910. Mordell, L. J.: Three Lectures on Fermat's Last Theorem, Cambridge Uni- versity Press, London, 1921. Neugebauer, O. : Mathematische Keilschrifttexte, 3 vols., Verlag Julius Springer, Berlin, 1935-1937. and A. Sachs: Mathematical Cuneiform Texts, American Oriental Series, Vol. 29, New Haven, 1945. Thureau-Dangin, F. : Textes mathematiques babyloniens, Leiden, 1938. Vandiver, H. S. : "Fermat's Last Theorem, Its History, and the Nature of the Known Results Concerning It," American Mathematical Monthly, Vol. 53, 555-578 (1946). Woepke, F. : Extrait du Fakhri, Paris, 1853. CHAPTER 9 CONGRUENCES 9-1. The Bisquisitiones arithmeticae. Who were the greatest mathematicians of all times? If one should put this question to a gathering of mathematicians, there would of course be disagree- ment, but a considerable number would undoubtedly state as their choices: Archimedes, Newton, and Gauss. Among these, Gauss is the only one whose work made an essential contribution to the theory of numbers. One could go further and state that while Fermat was the father of number theory as a systematic science, Gauss inspired the modern phase of the subject. His most important work on the properties of numbers is the Disquisitiones arithmeticae, which appeared in 1801 when he was twenty-four years of age. Carl Friedrich Gauss (1777-1855) was the son of a bricklayer who on the whole was quite opposed to the idea of an advanced education for the boy. The young Gauss was, however, a preco- cious child whose ability so overwhelmed his teachers that as a fourteen-year-old boy he was presented to Carl Wilhelm Ferdinand, the Duke of Brunswick. The duke financed his education and granted him a small pension on which he lived until the tragic death of the duke in 1806, on the flight from Napoleon's armies. The next year Gauss was appointed director of the university observatory in Gottingen. Here he lived until his death, secluded and reserved, caring little for students and pupils, indifferent to honors, but bringing forth from time to time some masterpiece <f| mathematical creation. His contemporaries looked up to him with awe and universally acclaimed him the princeps maihe* 209 210 NUMBER THEORY AND ITS HI STORY maticorum. His contributions covered practically all fields of mathematics, pure and applied, including mechanics, astromony, physics, geodesy, and statistics. The Disquisiliones arithemeticae has often been pronounced the greatest among his many great works, both in results and in the depth of its new ideas. Many problems, some of them previously Fif; Carl Fried rich Gauss (1777-1855). attacked in vain by prominent mathematicians, here received their solution for the first time. In the opening sections Gauss intro- duces a new calculus, the theory of congruences, that almost immedi- ately gained general acceptance and ever since has put its stamp on all terminology in number theory. The subsequent chapters will be applied to the discussion of various aspects of this theory. In a devoted statement Gauss dedicates the Disquisitiones to his patron, the Duke of Brunswick and Lunebourg, praising him particularly because he had been willing to lend his support also to those parts of science "which appear most abstract and with less application to ordinary usefulness, because in the depth of your wisdom, able to profit by all which tends to the happiness CONGRUENCES 211 and prosperity of society, you have felt the intimate and necessary liaison which unites all sciences." In the introduction Gauss mentions earlier investigations in the theory of numbers, particu- larly those by Euclid and Diophantos as well as those by Fermat, Euler, Lagrange, and Legendre. He relates that he began his research in the theory of numbers when he was eighteen years old and that he had been so attracted to these questions that a con- siderable part of the Disquisitiones had been completed before he became familiar with the results of other mathematicians. But "reading the works of these men of genius I was not late in recog- nizing that I had employed the greater part of my meditations on things known for a long time; but animated by a new ardor in following their steps, I exerted myself to advance further the cultivation of number theory." In the final presentation he included many of his earlier and previously known results to give a systematic view of the whole field. 9-2. The properties of congruences. Gauss introduces his congruences through the following definition: Two integers a and b shall be said to be congruent for the modulus m when their difference a — b is divisible by the integer m. This he expresses in the symbolic statement a = b (mod m) (9-1) When a and b are not congruent, they are called incongruent for the modulus m and this is written a ^ b (mod m) These terms, as one sees, are derived from Latin, congruent mean- ing agreeing or corresponding while modulus signifies little measure. The latter term is often shortened to modul. Let us illustrate the definitions by a few examples. One has for instance 26 = 16 (mod 5) since the difference 26 — 16 = 10 is divisible by 5; also 12 = 39 (mod 9) 212 NUMBER THEORY AND ITS HISTORY since 12 - 39 = -27 is divisible by 9, while 3 ^ 11 (mod 7) because 3 — 11= —8 is not divisible by 7. Gauss uses the examples ^ ^ _ g (mod fi) -7 = 15 (mod 11) -7 ^ 15 (mod 3) One can state the congruence (9-1) slightly differently by saying that b is congruent to a when it differs from a by a multiple of m b = a + km (9-2) There are certain basic properties of congruences, which we shall enumerate. The first is 1. Determination. For any pair of integers a and b one has one or the other of the alternatives a = b (mod m), a ^ b (mod m) In other words, either the difference a — b is divisible by m or it is not. The second property is equally trivial : 2. Reflexivity. One has a = a (mod m) This states only that a — a = is a multiple • m of any number m. 3. Symmetry. When a = b (mod m) then one also has b = a (mod m) This is clear since when the difference a — b is divisible by m so is 6 — a. The last property of this kind is 4. Transitivity. When a = b (mod m), b = c (mod m) then a = c (mod m) CONGRUENCES 213 To prove it we need only observe that a — c = (a — 6) + (6 — c) is divisible by m according to the first two congruences. These four properties 1-4 show that the congruences for some given modul define a relation between any two numbers of a type that in mathematics is called an equivalence relation. The best- known example of such a relation is the ordinary equality a = b It may be of interest to observe that the equality may itself be considered to be a congruence, namely for the modulus 0, since according to (9-2) the congruence a = b (mod 0) signifies that a = b. This artificial terminology is not in use. There is, however, another relation that may be expressed conveniently by means of congruences. As one sees immediately from the definition of a congruence, the fact that a number a is divisible by a number m may be stated a = (mod m) For example, one has 6 = (mod 2), 35 = (mod 5), 13 ^ (mod 7) The even numbers n are characterized by n = (mod 2) Problems. Verify the congruences 1. 40 ^ 13 (mod 9) 4. 11 = 23 (mod 12) 2. 7 ^ 99 (mod 13) 5. 132 s (mod 11) 3. 3 4 = 1 (mod 5) 6. 7 2 = 1 (mod 8) 9-3. Residue systems. When an integer a is divided by another m, one has a = km + r (9-3) 214 NUMBER THEORY AND ITS HISTORY where the remainder r is some positive integer less than m. Thus for any number a there exists a congruence a = r (mod m) where r is a unique one among the numbers 0, 1, 2, . . . , to - 1 (9-4) For this reason the set (9-4) is called a complete residue system (mod m). One has for instance 35 s 2 (mod 11), -11 = 5 (mod 8) On the other hand, all numbers a that are congruent to a given remainder r in (9-4) will be of the form (9-3), where k is an arbi- trary integer. Since these are the numbers that correspond to the same remainder r when divided by m, we say that they form a residue class (mod m). There are m residue classes (mod m). For a given remainder r the residue class to which it belongs consists of the numbers r, r ± m, r ± 2m, • • • According to our definition the congruence a = b (mod m) signifies that the numbers a and b differ by a multiple of m; consequently the congruence can also be expressed in the terms that a and b belong to the same residue class (mod m). Note : We have previously (Sec. 7-3) introduced the term modul as a set of numbers closed with respect to addition and subtraction. This is a somewhat different concept from the congruence modul just defined; in the following we shall use the term only for con- gruences so that no confusion can arise. The two concepts are, however, closely related. We showed in theorem 7-6 that a modul as a set of integers consisted of all multiples 0, ± to, ± 2m, • ■ • CONGRUENCES 215 of an integer m, so that this set is the zero residue class (mod m), i.e., the set of all numbers a for which the congruence a = (mod m) is fulfilled. Examples. 1. For the modulus m = 2 there are two remainders, and 1, and the corresponding residue classes are •••, -4, -2, 0, 2, 4, ... ••-, -3, -1, 1, 3, 5, ••• consisting respectively of the even and odd numbers. 2. When m = 3 there are three residue classes • • • , -6, -3, 0, 3, 6, ••• ••-, -5, -2, 1, 4, 7, ••• ■••,. -4, -1, 2, 5, 8, ••• 3. Prove that all numbers in a residue class have the same g.c.d. with the modulus m. ,_ There are many other residue systems such that every number is congruent (mod m) to a single one among them. We may ( recall, for instance, that in the division process we sometimes found it convenient to use least absolute remainders. In general we shall say that m numbers «i, «2, • • . , a m (9-5) form a complete system of residues if every number is congruent to some Ojf. One sees that to obtain such a system one must pick one Of from each of the m residue classes. To examine whether the numbers (9-5) form a complete residue system, one can verify that they aie congruent to the numbers (9-4) in some order. For jiST&ance, the numbers 32, -1, 8, 20, 11 216 NUMBER THEORY AND ITS HISTORY form a complete system of residues (mod 5) since one has the congruences 32 = 2, -1=4, 8 = 3, 20 = 0, 11 = 1 (mod 5) Another way of determining that the m numbers (9-5) form a com- plete system of residues would be to show that no two of them are congruent at 7^ aj (mod m) since in this case they would all belong to different residue classes. Problems. 1. Show that the numbers -3, 14, 3, 12, 37, 50, -1 form a complete residue system (mod 7). 2. Do the numbers 5, 12, -3, -4, 9, 22 form a complete residue system (mod 6)? 9-4. Operations with congruences. We began by emphasizing that some of the basic properties of congruences are the same as those of ordinary equality. We shall now pursue this analogy further and establish that one can operate with congruences according to rules that in many ways resemble those used in combining equations. A little later on we shall show that several important applications of congruences depend on this fact. This first property we mention is: Theorem 9-1. Congruences for the same modul may be added and subtracted. If a = b; c = d (mod m) (9-6) then a + c = b + d; a — c = b — d (mod w) To prove, for instance, the first one of these congruences, it is sufficient to observe that the difference a + c - (6 + d) = (a-b) + (c- d) CONGRUENCES 217 is divisible by m according to the two given congruences (9-6). As an example, we may take 5 = 32; 11 = -7 (mod 9) By addition and subtraction one finds the new congruences 16 = 25; 6 = -39 (mod 9) which are also seen to be correct. By repeated application of the addition rule, it follows that one can add an arbitrary set of congruences for the same modulus. For instance, from the three congruences 47 = -5 (mod 13) 11 = 37 (mod 13) 1 = -25 (mod 13) one obtains by addition of the numbers on both sides 59 = 7 (mod 13) Another application of the addition theorem results in: Theorem 9-2. A congruence may be multiplied by an arbi- trary integer. From a = b (mod m) it follows that ka = kb (mod m) Clearly the new congruence has been obtained by adding the given congruence to itself k times. For instance, from 3 = 7 (mod 4) one concludes by multiplication with 5 that 15 = 35 (mod 4) The next result is: Theorem 9-3. Two congruences may be multiplied together. From the congruences in (9-6) one obtains ac = bd (mod m) (9-7) 218 NUMBER THEORY AND ITS HISTORY This may be derived in various ways; one can, for instance, multiply the first congruence (9-6) by c and the second by b so that ac = be = bd (mod m) One can also express the difference between the two sides in the congruence (9-7) in the form ac — bd = (a — b)c + b(c — d) showing that it is divisible by m. To illustrate, the multiplication of the two congruences 3 s 14, 9 = -2 (mod 11) gives 27 = -28 (mod 11) Again the multiplication rule may be applied to several con- gruences. In particular, a congruence may be multiplied by itself any number of times so that a = b (mod m) implies a n = b n (mod m) for any exponent n. Since any of the operations of addition, subtraction, and multi- plication when applied to congruent numbers will give congruent results, we conclude that any algebraic expression constructed by repeated use of these operations will give congruent results when congruent values are substituted. For instance, since -2 = 3 (mod 5) the polynomial Six) = x 3 - Sx + 6 must give congruent results when —2 and 3 are substituted. One finds actually /(-2) = 14 = 9 = /(3) (mod 5) CONGRUENCES 219 The same would hold if one took two polynomials in which the corresponding coefficients were congruent. For instance, the polynomials f(x) = x 3 - 8x + 6, g{x) = ±x 3 - 3x 2 - 2x - 3 have congruent coefficients (mod 3), namely, 1=4, = -3, -8 = -2, 6 = -3 (mod 3) Thus the two values x = — 2 and x = 1, which are congruent (mod 3), must give congruent values when substituted in/(x) and g(x), respectively. One sees that /(-2) = 14 = -4 = g(l) (mod 3) Analogous results must hold if one takes expressions with several variables. These rules for the computation with congruences are, as we have seen, quite simple and analogous to those for equations. Nevertheless, the reader who makes his beginning steps with this somewhat unfamiliar and strange calculus will need a little time and several examples to gain the necessary confidence in the method. After some experience it will become clear how much the notion of congruences facilitates certain kinds of considerations in number theory. Examples. 1. Let us determine the smallest positive remainder (mod 17) of the number 37 when raised to the thirteenth power. Problems of this kind are quite common in the theories we shall discuss in the next chapter. Clearly one could compute the large number 37 13 and find its remainder when divided by 17. However, by congruences we proceed in much simpler fashion as follows. We observe first that 37 = 3 (mod 17) By squaring this congruence, one finds 37 2 = 9 (mod 17) and by repetition 37 4 a 81 = -4 (mod 17) 220 NUMBER THEORY AND ITS HISTORY Squaring again, one finds 37 8 = 16 = -1 (mod 17) By multiplying the congruences for the first, fourth, and eighth powers of 37 one obtains 37 13 = 37 • 37 4 • 37 8 = 3(-4)(-l) = 12 (mod 17) so the remainder is 12. 2. Compute the remainder of the expression A = 531xV \ x = 31, y = 2 for the modulus 7. One finds for the modulus 7 x = 31 = 3, y z = 8 = 1 x 2 = 9 = 2, y 9 = 1 531 = -1, y 11 a 4 ■ 1 = 4 Ah -1-2-4= -8 a6 (mod 7) /(x) = 3x 7 - 41a; 2 - 91a; Consequently 3. Let and find /(ll) (mod 13). ! One sees that 41 = 2, 91 = (mod 13) so that for any x f(x) = 3a; 7 - 2x 2 (mod 13) Furthermore in this case x = 11 = -2 a; 2 =4 x 4 = 16 = 3 x 1 = -2 • 4 • 3 =. 2 4 , „ o ( mod 13 ) so that /(ll) ^3-2-2-4= -2 = 11 (mod 13) So far we have indicated only those rules for congruences corresponding to those that are familiar for equations. We shall now supplement this by deriving a number of properties for con- gruences that do not have an analogue among the properties of equations. Almost trivial is Theorem 9-4. If then one also has CONGRUENCES 221 a = b (mod m) a = 6 (mod d) where d is any divisor of the modulus m. Clearly, if a — b is divisible by ra, it is divisible by any divisor d of m. For instance, one has 23 = - 1 (mod 12) and therefore 23 = -1 (mod 4), 23 = -1 (mod 3) Another fact that is often used in computations with congruences is the following: Theorem 9-5. When a congruence holds for two different moduls, it holds for their least common multiple. If a = b (mod mi), a = b (mod m^) then a = b (mod M), M — [mi, m 2 ] Conversely, the last congruence implies each of the first two. The proof is an immediate consequence of the fact that when the difference a — b is divisible both by mi and m 2 , it is divisible by their l.c.m. M. Clearly the rule extends to an arbitrary number of moduls. In the example 37 = 109 (mod 8), 37 = 109 (mod 12) it follows that 37 = 109 (mod 24) The converse is a consequence of theorem 9-4. Let us state separately a special application of theorem 9-5 that appears commonly: Theorem 9-6. When a set of congruences a = b (mod m*) i = 1, 2, • • • , k (9-8) 222 NUMBER THEORY AND ITS HISTORY holds where the moduls ra* are relatively prime in pairs, then one also has the same congruence for the product of the moduls a = b (mod miw 2 • • • m&) (9-9) and conversely from (9-9) each of the congruences (9-8) follows. We need only to recall that the l.c.m. of relatively prime numbers is equal to their product. Theorem 9-6 is often useful in reducing the study of congruences to the case of moduls that are powers of primes. If the modul has the prime factorization m = pi ai p 2 ai • ' ' Vk ak then the congruence a = b (mod m) (9-10) implies each one of the congruences a = b (mod Pi tti ) (9-11) and these, in turn, together imply (9-10). One has for instance 730 = 10 (mod 180) and therefore also 730 = 10 (mod 2 2 ), (mod 3 2 ), (mod 5) and conversely this system of congruences is equivalent to the original. The final rules we wish to establish refer to the division of a congruence by a number. We have seen in theorem 9-2 that in a congruence both sides may be multiplied by the same integer. Now let us consider conversely when one can cancel a common factor on both sides. This is not always possible as the following example shows. In the congruence 36 ss 92 (mod 8) the numbers on both sides are divisible by 4, but if this factor is canceled, there remains 9 = 23 (mod 8) which is incorrect CONGRUENCES 223 Let as see how the cancellation rule must be modified. When a congruence ak = bk (mod m) holds, it means that the difference ak — bk must be divisible by m so that (a - b)k = Im (9-12) where I is some integer. We assume that k and m have the g.c.d. d = (k, m) and divide (9-12) by it to obtain (a - b) - = I - a a Here the two numbers k/d and m/d are relatively prime, and since the product on the left is divisible by m/d, one concludes that a — b must be divisible by m/d, in other words We can therefore state: Theorem 9-7. In a congruence ak = bk (mod m) the common factor k can be canceled «- 6 ( mod f) provided the modulus is divided by the greatest common divisor d of k and w. In the previous example 36 = 92 (mod 8) cancellation by 4 gives, according to this rule, 9 = 23 (mod 2) Similarly, in the congruence 220 = 1,180 (mod 96) 224 NUMBER THEORY AND ITS HISTORY both sides have the common factor k = 20, and d = (20, 96) = 4. Consequently, after cancellation with 20, there remains 11 s 59 (mod 24) Again, the theorem 9-7 has two special cases that are so im- portant we mention them separately : Theorem 9-8. In a congruence ak = bk (mod m) the factor k may be canceled a = b (mod m) provided k is relatively prime to the modul m. For instance, in the congruence 27 = 102 (mod 25) one can cancel by 3 9 = 34 (mod 25) since 3 is relatively prime to the modul. Finally: Theorem 9-9. If in a congruence a = b (mod m) the three numbers a, b, and m are divisible by a number d, then i( mod f) a d~ d\ Problems. 1. Add, subtract, multiply, and square the two congruences 31 s-7, 3 = 22 (mod 19) and check the results. 2. Compute the least positive residue of each of the numbers (a) 2 U (mod 17) (b) ll 35 (mod 13) (c) 2 21 (mod 11) (d) 3 100 (mod 5) CONGPMENCES 225 3. Compute the residues of /(2) and/(13) (mod 12) when fix) = 73x 9 - lllx 7 + 32x - 14 4. Find the residue (mod 19) of the expression B = Slx 2 y + 17y 4 x 5 , x = 11, y = 24 5. Compute the remainders of the numbers 2! = 1-2, 3! = 3-2-1, 4! = 4 • 3 • 2 • 1, ... and in general the remainder of n! for the modulus n + 1 up to n = 10 and try to establish a general rule. 6. In the following congruences cancel the common factors on both sides : (a) 284 = 1,224 (mod 48) (6) 45 m 150 (mod 7) (c) 168 = -48 (mod 72) 9-5. Casting out nines. Until now we have mainly compiled rules for handling congruences, and the time has come to touch upon some simple applications to illustrate their usefulness. Towards the end of the first section of the Disquisitiones Gauss points out how one can, by means of congruences, derive general methods for checking numerical computations. Such checks are of ancient origin and may have been obtained from India by the Arabs together with the Hindu numerals. They occur in many of the Arab reckoning manuals, for instance, in the influential works of al-Khowarizmi and al-Karkhi, and so they came into gen- eral use in Europe in the Middle Ages. These checks were particularly useful at a time when familiarity with arithmetic manipulations was not as widespread nor as thorough as at present. Furthermore, in computations on the abacus or casting on the lines, once the calculation was completed there remained no permanent record whose details could be re- checked. Nowadays these control methods, even the simplest and the most common one, casting out nines, have largely gone out of use and are no longer explained in the elementary texts in arithmetic. Occasionally we check our computations by the inverse operations, for instance, subtraction by adding the sub- tracted number to the difference, or division by multiplying back 226 NUMBER THEORY AND ITS HISTORY again, but in most cases the check is performed simply by going over each individual step in the calculation again. However as anyone who has spent some time at numerical computations will realize, one is apt to succumb to the same pitfalls in repeating the procedure the second or third time, or in mechanical computation the machine may fail in the same manner as previously. Con- sequently for any large-scale computation it is, if not absolutely necessary, at least very desirable to have some independent check- ing method for the results. Since we perform our computations in the decadic system of numbers, we shall limit our considerations to such systems, but, as we will see, there is no difficulty in extending the results to arbitrary base numbers other than 10. Let N = (a n , a n _i, • • • , ai, a ) (9-13) = a«10 n + a n _ilO n ~ 1 H 1- a 2 100 + a x \Q + a denote a number written in the decadic system so that the digits ai may have values from to 9. It is simple to find the remainder of N when divided by divisors of the base number. For instance, since 2 divides 10 and all powers of 10, it follows from (9-13) that N = a (mod 2) Consequently, N is divisible by 2 only when the last digit is divisible by 2, hence when a has one of the values «o = 0, 2, 4, 6, 8. Similarly, since 4 divides 100 and all higher powers of 10, one has N = ttilO + a (mod 4) so that N is divisible by 4 only when the number represented by the two last digits is divisible by 4. For example, the number N = 7,342 = 42 = 2 (mod 4) is not divisible by 4. Equally simple and familiar are the rules for divisibility by 5 or 25. One sees that N = a (mod 5) CONGRUENCES 227 so that N is divisible by 5 only when a = or 5; one also has AT s£ ailO + a (mod 25) so a number is divisible by 25 only when it ends in 00, 25, 50, or 75. More interesting are the rules one can derive for the remainders and divisibility by other numbers that are relatively prime to 10. We begin by considering the number N in (9-13) for the modul m = 9. Since one has 10 = 1 (mod 9) it follows that 10 2 = 1, 10 3 = 1, • • • (mod 9) so that we find from (9-13) N = a + a x -\ (- a n (mod 9) (9-14) This congruence expresses the basis for the process of casting out nines. It shows that by division with nine a number has the same remainder as the sum of the digits. One may notice that on an abacus or by computations on the lines this sum of the digits is a number that appears naturally since it is the number of counters or jetons that one uses to represent the number. When the rule (9-14) is applied to find the remainder of a number with respect to the divisor 9, the sum of the digits may itself be a fairly large number, which one can reduce further by repeated application of the same rule. For instance, N = 39,827,437 = 3 + 9 + 8 + 2 + 7 + 4 + 3 + 7 = 43 = 4 + 3 = 7 (mod 9) One concludes immediately from the congruence (9-14): A number is divisible by 9 only if the sum of its digits is divisible by 9. Example. The number N = 234,648 s2+3+4 + 6+4 + 8 = 27=0 (mod 9) is divisible by 9. 228 NUMBER THEORY AND ITS HISTORY Since the congruence (9-14) also will hold for the divisor 3 of 9, exactly the same rules as for 9 apply for the remainders and divisibility by 3. For instance, a number is divisible by 3 only when the sum of the digits is divisible by 3. Example. N = 874,326 ^8 + 7 + 4 + 3 + 2 + 6 = 30 =3 (mod 9) is a number divisible by 3 but not by 9. Another number for which simple divisibility rules can be established is m = 11. In this case one verifies that 10= -1, 10 2 = 1, 10 3 = -1, 10 4 = 1, • • • (mod 11) and one concludes from (9-13) N = a — «i + a 2 — a s + • • • (mod 11) (9-15) Example. N = 39,827,437 =7-3+4-7 + 2-8 + 9-3 = 1 (mod 11) so that this number is not divisible by 11. Rules for remainders and divisibility by other numbers have been derived but they are less simple than those we have already obtained. Leonardo Fibonnaci in his Liber abaci, in addition to the rules for 9 and 11, also gives a rule for the number 7. As we have seen, these rules depend essentially on the behavior of the powers of 10 for the chosen modulus. When m = 7, one obtains successively 10 = 3, 10 2 = 2, 10 3 =-1, 10 4 =-3, 10 5 = -2, 10 6 = 1 (mod 7) Consequently one has N = a + 3ai + 2a 2 — a 3 — 3a 4 - 2a 5 + a 6 • • • (mod 7) (9-16) CONGRUENCES 229 Example. N = 39,827,437 = +7 + 3-3 + 2-4-7 -3-2-2-8 + 9+3-3 = 13 =6 (mod 7) shows that this number is not divisible by 7. We shall now turn to the application of these residue rules to give checks for the correctness of arithmetic operations. These methods are based on the idea that when an operation of addition, subtraction, or multiplication has been performed on certain integers, the result must be correct also when considered as a congruence for an arbitrary modulus. For instance, let c = ab (9-17) be a product obtained by the multiplication of two numbers a and b. Then the congruence c = ab (mod m) (9-18) must hold for any modulus m. By selecting m as a number for which the residues may easily be computed by means of the pre- ceding rules, the congruence (9-18) may be verified without much effort. If it should fail to hold, the multiplication (9-17) is not correct. On the other hand, if the congruence is fulfilled, the result (9-17) is not necessarily correct, but the chance of an error is considerably reduced. When casting out nines, one uses the modulus m = 9. Examples. 1. Let us take the multiplication (9-17) when a = 8,297, b = 3,583, c = 29,728,151 (9-19) Here one finds a = 8 + 2 + 9 + 7 = 26 e-1 &=3+5+8 + 3 = 19sl (mod 9) cs2 + 9+7 + 2 + 8 + l+5 + l=35= -1 Consequently ab = —1, c = — 1 (mod 9) 230 NUMBER THEORY AND ITS HISTORY as one should expect. We shall also check the multiplication (9-19) for the modulus 11. Then by (9-15) o=7-9+2-8s3 6 = 3-8 + 5-3 = -3 (mod 11) csl-5+l-8+2-7+9-2=2 and therefore a& = 3(-3) = 2, c = 2 (mod 11) 2. Let us assume that in (9-17) one has a = 7,342, & = 2,591, c = 19,032,122 (9-20) By casting out nines, one finds a = 7, 6=8, c = 2 (mod 9) which checks, since ab = 2 (mod 9) But when one uses the modul 11, one finds from (9-20) a = 5, 6=6, c = 10 (mod 11) and this indicates that there must be an error in the multiplication since ab = 30 = 8 ^ c (mod 11) By performing the multiplication a second time one finds that the correct value should have been c* = 19,023,122 This illustrates the fact that casting out nines will not catch the rather com- mon error of two digits having been interchanged. These checking methods may be used analogously for addition and subtraction but they are of lesser importance since these operations may be so easily repeated. On the other hand, for division the checks are quite convenient. When an integer a is divided by 6 with the incomplete quotient q and the remainder r, the relation a = qb + r must hold for every modulus. CONGRUENCES Example. Let a = 76,638,123, b = 37, By performing the division one finds 1 = 2,041, r = 4,696 231 Casting out nines gives a = 0, 6 = -1, q = -2, r = -2 (mod 9) and this is correct since ? fe + r = (_2)(-l) -2=0 (mod 9) similarly a = 1, 6=4, ? = -5, r = -1 (mod 11) which again checks, since qb + r = 4(-5) -1 = 1 (mod 11) With large figures it is more efficient to take larger moduls for check purposes. One may, for instance, use m = 99 since in this case 10 2 =1, 10 4 = 1, • • • (mod 99) and from (9-13) one obtains N = a + 10a! + a 2 + 10a 3 -\ (mod 99) This means that one finds the remainder (mod 99) by splitting JV up into two digit numbers and taking their sum. For instance, when N = 7,342,948 one has N = 48 + 29 + 34 + 7 = 19 (mod 99) Similarly one finds for the modul m = 101 N = a + 10ai - (a 2 + 10a 3 ) + (a 4 + 10a 5 ) - • • • (mod 101) hence in the example we just used TV = 48 - 29 + 34 - 7 = 46 (mod 101) 232 NUMBER THEORY AND ITS HISTORY Let us check the multiplication 728,223 X 5,535,064 = 4,030,760,911,272 by these two moduls. For the three numbers one finds in the given order (mod 99) 23 64 72 +82 +50 + 12 +72 +53 +91 177 = 78 + 5 +60 = -21 172 = 73 +07 -26 +03 + 4 249 = 51 The fact that (-21) (-26) = 51 (mod 99) points to a correct result. Had one used the modulus 101, the check would have looked as follows : 23 64 72 -82 -50 -12 +72 +53 +91 13 - 5 -60 62 + 7 - 3 + 4 99 = here one has 13 62 = -2 (mod 101) -2 In number theory one often runs into computations with very large numbers, exceeding even the capacity of the machines, so that multiplications and divisions may have to be performed in installments. Furthermore, there may be chains of computations where the result of one step enters into the next. This, for instance, is the case in some of the methods for deciding whether CONGRUENCES 233 a number is a prime or not. Under such circumstances it is particularly important to have efficient checks, and one introduces moduls for even higher numbers than those just mentioned. It is convenient to take m = 999, m = 9,999, . . . since this leads to a simple addition of the digits of the numbers in groups of three, four, and so on, or one may also take m = 1,001, . . . and add and subtract such groups of digits alternatingly. By means of adding machines these checks may be performed with relatively small effort in comparison with the work involved in a complete repetition of the operation. Problems. 1. In Arab and medieval European arithmetics one finds checks for to = 7, 9, 11 and also for m = 13 and m = 19. Determine the form of the residue rules for the two last moduls. 2. Why does to = 17 not give a simple rule? 3. Try to give a criterion for the divisibility of a number by 37. 4. Check the following multiplications and divisions by several of the rules established above: (a) 14,745 X 19,742 = 291,095,790 (6) 52,447 X 81,484 = 4,279,531,348 (c) 24,726,928,309 = 3,569,644 X 6,927 + 4,321 (d) 41,587 2 = 1,729,478,569 5. If a is a number in the decadic system and b the number with the same digits in the reverse order, prove that a — b is divisible by 9. 6. What rule corresponds to the simultaneous use of the moduls 7, 11, and 13? Bibliography Gauss, C. F. : Disquisiliones arithmeticae, Leipzig, 1801. French translation by A. C. M. Poullet-Delisle: Recherches arithmetiques, Paris, 1807. CHAPTER 10 ANALYSIS OF CONGRUENCES 10-1. Algebraic congruences. The congruences, as we have already indicated several times, have many properties in common with equations and this analogy we shall now pursue further. In equation theory one tackles the problem of finding the roots of an algebraic equation fix) = i.e., the numbers x that satisfy this condition, where fix) is some given polynomial. Similarly, in the theory of congruences one can propose the problem of finding those integers x that fulfill a certain congruence fix) = (mod m) (10-1) for some modul. Since we deal only with integers, we must in this case suppose that f(x) is a polynomial with integral coefficients. As an example, let us take the congruence f(x) = x 3 4- 5x - 4 s (mod 7) (10-2) It is satisfied when x = 2 since /(2) = 14 = (mod 7) As for equations, we say that x = 2 is a root or solution of the congruence. But since congruent values of x will give congruent values of the polynomial, as we mentioned earlier, any value of x congruent to 2 (mod 7) must also be a solution. In the theory of congruences it is therefore agreed to consider all values x = 2 (mod 7) 234 ANALYSIS OF CONGRUENCES 235 as one solution. In the general case (10-1) the situation is the same. When a solution x — xq has been found, all values x for which x = x (mod m) are also solutions and by convention we consider them as a single solution. As a consequence, to find all solutions of a congruence (10-1) we need only try all values 0, 1, . . . , m — 1 [or the numbers in any other complete residue system (mod m)] and determine which of them satisfy the congruence; this gives us the total number of different solutions. In the example (10-2) we should try the numbers from to 6 or, more conveniently, the numbers from —3 to +3. One finds that there is only the single solution x = 2. The number of solutions of a congruence may vary considerably; there may be none or the number may even greatly exceed the degree of the congruence. Examples. 1. The congruence x 2 + 5 = (mod 11) has no solutions as one establishes by trying the eleven values 0, ±1, ±2, ±3, ±4, ±5. 2. The congruence has the two solutions x 3 - 2x + 6 = (mod 5) x = 1, x = 2 (mod 5) x 3 s (mod 27) 3. The congruence has nine solutions x = 0, x s ±3, x = ±6, x = ±9, x = ±12 (mod 27) The theory of algebraic congruences is an interesting but quite complicated and difficult field, in which many investigations have been made during the last century. A few essential facts about special congruences will be derived subsequently since they enter into some of the applications of the theory of congruences that 236 NUMBER THEORY AND ITS HISTORY we wish to make. For the moment we shall be content to have introduced the basic concepts. Problems. Find all solutions of the following algebraic congruences: 1. x 2 = 5 (mod 11) 5. x 3 - 3x 2 - 3 =* (mod 13) 2. x 2 = 4 (mod 15) 6. x 4 - 2x + 5 = (mod 7) 3. x 2 = 1 (mod 32) 7. x 3 - 3x 2 + 7x + 2 = (mod 12) 4. x 3 = (mod 25) 8. x 10 = 1 (mod 11) 10-2. Linear congruences. The simplest congruences are those of first degree, or linear congruences. ax = b (mod m) (10-3) Before we proceed to the general method for solving such con- gruences we shall give a few examples to illustrate that there are various possibilities which may occur. Examples. 1. The congruence 7x s 3 (mod 12) has the single solution x = 9 (mod 12) as one concludes by trying out the integers from to 11. 2. The congruence 12x = 2 (mod 8) is found to have no solution. 3. Finally the congruence 6x = 9 (mod 15) has three solutions x = 4, x = 9, x s 14 (mod 15) We now return to the general linear congruence (10-3). Accord- ing to the definition of congruences, this equation means that there shall exist some integer y such that ax — b = my or ax — my = b (10-4) ANALYSIS OF CONGRUENCES 237 This shows that the solution of a congruence (10-3) is equivalent to the solution of a linear indeterminate equation (10-4), and since we have already analyzed such equations quite exhaustively, the results may be transferred directly to congruences. We recall first that an indeterminate equation (10-4) has a solution only if the greatest common divisor of the coefficients of x and y also divides the constant term b. Therefore we can state: Theorem 10-1. A linear congruence (10-3) is solvable only when the greatest common divisor d = (a, m) divides b. In the first example given above d = (7, 12) = 1 divides b = 3 so that the congruence is solvable. Similarly in the third example d = (6, 15) = 3 divides b = 9 so that there are solutions. But in the second example d = (12, 8) = 4 does not divide b = 2 so that no solution can exist, as we found directly. Let us consider the general indeterminate equation (10-4) and suppose that d divides b so that it is solvable. We can cancel d in each term and obtain d m b - x - - y = - (10-5) add This equation, as one sees, corresponds to the linear congruence In (10-5) the coefficients of x and y are now relatively prime, and we can solve the equation by means of our previous methods. We 238 NUMBER THEORY AND ITS HISTORY recall that if x and yo is an arbitrary solution of (10-5), the general solution has the form m , . m . x = x ° ~d ' V = y ° 1 ' where t is an arbitrary integer. This gives us as the general solution of the congruences (10-6) and (10-3) (7Yl\ mod — I (10-7) There is one further remark that must be made. In connection with congruences we agreed that the different solutions were the numbers satisfying the congruence and not congruent to each other (mod m). The numbers (10-7) are not all congruent (mod m). If we select x , as we may, to be a positive integer less than m/d, all the numbers xo, *o + ^, aJo + 2-,---, xo + (d-l)- (10-8) satisfy the congruence and are incongruent (mod m), since they are less than m. Then the d numbers (10-8) define different solutions of the original congruence (10-3). To summarize: Theorem 10-2. A congruence ax = b (mod m) is solvable only if the greatest common divisor d = (a, m) divides b, and when this is the case there are d solutions given by (10-8). When a and m are relatively prime, the congruence has a single solution. In the first example above we had d = 1 so that there was one solution. In the third example we had d = 3, and when this factor was canceled the congruence became 2x = 3 (mod 5) with the general solution x = 4 (mod 5) ANALYSIS OF CONGRUENCES 239 Corresponding to (10-8) it follows that since the modul in the original congruence was 15, one has altogether three solutions x = 4, x = 9, x = 14 (mod 15) Examples. 1. The congruence has no solution since does not divide b = 8. 2. The congruence 36x s 8 (mod 102) d = (36, 102) = 6 19a; = 1 (mod 140) has a single solution since d = 1. To obtain it we solve the equation 19x - 140y = 1 by means of our previous procedure based upon Euclid's algorism 140 = 19 • 7 + 7 59 19 = 7-2 + 5 8 7 = 5-1+2 3 5 = 2-2 + 1 2 1 The solution is therefore i=59 (mod 140) 3. Finally in the example 144a; = 216 (mod 360) one has d = 72, and this number divides b = 216 so that there are 72 different solutions (mod 360). When the factor d is canceled in the congruence, there remains 2x =Z (mod 5) which has the solution x = 4 (mod 5) The 72 solutions of the original congruence are as in (10-8) x = 4, x = 9, x = 14, • • • , x = 359 (mod 360) 240 NUMBER THEORY AND ITS HISTORY Problems. Solve the congruences 1. 7x s 3 (mod 10) 4. 20x = 7 (mod 15) 2. 15x a 9 (mod 12) 5. 315x = 11 (mod 501) 3. 221x = 111 (mod 360) 6. 360x = 3,072 (mod 96) 10-3. Simultaneous congruences and the Chinese remainder theorem. It is often required to find a number that has pre- scribed residues for two or several moduls. As an example, let us suppose that we wish to determine an integer x such that x = 5 (mod 11), x = 3 (mod 23) (10-9) The first condition (10-9) states that x = 5+ lit where t is some integer. In order that x shall satisfy the second congruence in (10-9), one must have 5 + lit = 3 (mod 23) or llt= -2 (mod 23) The solution of this congruence is obtained most simply by multi- plying both sides by 2 so that 22* s -t= -4 (mod 23) or t s 4 (mod 23) The general form for t is therefore t = 4 + 23w where u is some integer. When this is substituted into the ex- pression for x, one obtains x = 5 + 11(4 + 23w) = 49 + 11 • 23 • u po that the general solution of the two congruences (10-9) is x = 49 (mod 11 • 23) ANALYSIS OF CONGRUENCES 241 The method used in this example is applicable in the general case of two congruences x = a (mod m), x = b (mod n) (10-10) From the first of these, follows x = a + mt and the second shows that t must satisfy the condition a + mt = b (mod n) or mt = b — a (mod n) (10-11) According to the general rules we just derived, this linear con- gruence in t can only have a solution when the greatest common divisor d — {m, n) divides b — a; in other words, the condition a = b (mod d) must be fulfilled. When this is the case the congruence (10-11) may be divided by d *'- — ( mod s) (10 " 12) Let t Q be some particular solution of this congruence and xq = a + mto the resulting special solution of (10-10). The general solution of (10-12) is then t = tt so that we can write *( mod s) n t = t + u - d 242 NUMBER THEORY AND ITS HISTORY where u is some integer. The resulting general solution of the original congruence (10-10) is or since / , . n \ mn x = xq (mod [m, ri\) r .. mn [m, n] = -— a is the least common multiple of m and n. When one considers a set of algebraic congruences for several moduls and x is a number satisfying all of them, it is clear that if one adds any multiple of the l.c.m. of all moduls to x , the resulting number will also be a solution. Therefore, with several moduls it is agreed that the number of different solutions is given by the incongruent solutions for the l.c.m. of the moduls. We summarize as follows: Theorem 10-3. Two simultaneous congruences x = a (mod m), x = b (mod n) are solvable only when a = b (mod (w, n)) and then there is a single solution x = xq (mod [m, n]) which may be found by the method given above. Examples. 1. When x = 7 (mod 42), x = 15 (mod 51) there is no solution since d = (42, 51) = 3 and 7 ^ 15 (mod 3) ANALYSIS OF CONGRUENCES 243 2. In the example x = 3 (mod 14), x = 7 (mod 16) one has d = 2, and the condition for solvability is fulfilled; the answer is x s 87 (mod 112) When several simultaneous congruences are given x = a\ (mod mi), x = a 2 (mod ra 2 ), a; = a 3 (mod ra 3 ) (10-13) the solution may be found by repeated applications of the method given above. One combines the first congruences and finds a single congruence x = xq (mod [mi, m 2 ]) which can replace them in (10-13). This in turn is solved in con- junction with the third, and so on. One sees that if there exists a solution of the congruences (10-13), there is only a single one, with respect to a modul that is the l.c.m. of all moduls m;. Example. The following example is taken from the Disquisitiones: x = Y7 (mod 504), x = -4 (mod 35), x = 33 (mod 16) When the two first congruences are solved, one finds x = 521 (mod 2,520) and when this is combined with the third, the result is x = 3,041 (mod 5,040) Many puzzle questions belong mathematically to the type of problems solved by simultaneous congruences. In Chap. 6 we mentioned the ancient problem of the woman with a basket of eggs. When the eggs were taken out two at a time, there was one left; similarly, when they were taken out 3, 4, 5, and 6 at a time, there was always one egg left, while at seven at a time, the count came out even. In mathematical terms this means that x = 1 (mod 2, 3, 4, 5, 6) x = (mod 7) 244 NUMBER THEORY AND ITS HISTORY where x is the number of eggs. Since, according to the first con- gruences, the number x — 1 is divisible by all numbers 2, 3, 4, 5, and 6, it is divisible by their l.c.m., which is 60, and the conditions become x = l (mod 60), x = (mod 7) When these simultaneous congruences are solved, one finds x = 301 (mod 420) The smallest number of eggs the basket could have contained is therefore x — 301. The simple condition for the solvability of two simultaneous congruences given in theorem 10-3 can be extended to an arbitrary number of congruences as follows: Theorem 10-4. The necessary and sufficient condition for a set of simultaneous congruences x = di (mod mi) i _= 1, 2, • • ♦ ,"r (10-14) to have a solution is that for any pair di = aj (mod (m iy ray)) (10-15) and in this case, there is a single solution for the modulus M r = [mi, • - • , m r ] which is the l.c.m. of the given ones. We observe first that if the congruences (10-14) are to have a solution, any pair of them must be solvable so that according to theorem 10-3 it is necessary that the conditions (10-15) be ful- filled. To prove that these conditions are sufficient for the existence of a solution, we shall use the induction procedure. Theorem 10-3 states that the result is true for two congruences. We suppose, therefore, that the result is true when there are r — 1 congruences and from this we deduce it for r congruences. According to this assumption, there exists a solution xq = at (mod mi) i = 1, 2, • • • , r — 1 (10-16) ANALYSIS OF CONGRUENCES 245 of the r — 1 first congruences in (10-14), and any other such solu- tion x must be of the form x = x (mod Mr-i), M r _ x = [mi, • • • , m r _ x \ (10-17) To have a solution of all congruences (10-14), one must at the same time satisfy x = a r (mod m r ) (10-18) From theorem 10-3 we conclude again that the congruences (10-17) and (10-18) can have a common solution only when x = a r (mod (M r -i, m r )) (10-19) and in this case there is a single solution for the modulus [M r _ u m r ] = M r It remains, therefore, to show that the condition (10-19) is fulfilled for the x we have found. We observe that according to theorem 5-9 (ilf r _i, m r ) = ([mi, • • • , m r _i], m r ) = [(mi, m r ), • • • , (m r _i, m r )\ so that the congruence (10-19) is equivalent to the set of con- gruences (theorem 9-5) x = a r (mod (m;, m r )) i = 1, 2, . . . , r — 1 But these congruences are true, since one finds from (10-16) and (10-15) x = a,i (mod (mi, m r )), a» = a r (mod (m;, m r )) The special case where all moduls in the simultaneous con- gruences (10-14) are relatively prime in pairs occurs in many applications. According to theorem 10-4, there is a unique solu- tion to these congruences for a modul that is equal to the product of all the given ones. Gauss introduces a special procedure already used previously by Euler for the determination of the solution. The method, however, is ancient and occurs in the works of several early mathematicians. The first known source is the Arithmetic of the Chinese writer Sun-Tse, probably around the beginning of 246 NUMBER THEORY AND ITS HISTORY our era, and the resulting formula is often termed the Chinese remainder theorem. We begin by forming the product M = mim 2 - - • m r of the relatively prime moduls in the set of congruences (10-14). When M is divided by mi, the quotient M — = m 2 ' ' ' m r mi is a number divisible by all other moduls and relatively prime to mi. Similarly the number M — = Wi • • • m^imj+i • • • m r mi is divisible by all moduls except ra*, to which it is relatively prime. For each i one can, consequently, solve the linear congruence M hi — = 1 (mod mi) 610-2G) m,% The Chinese remainder theorem may then be stated: Theorem 10-5. Let a set of simultaneous congruences (10-14) be given for which the moduls m% are relatively prime. For each r . one determines 6; through the linear congruence (10-20). The solution of the set of congruences is then M M M x = ci-bi f- a 2 & 2 1 r- a r h — (mod M) (10-21) The verification of the solution (10-21) is immediate. For instance, to see that it satisfies the first congruence (10-14) we ecail that m\ divides all M/mi except M/m\ so that X s aibi — ss oi (mod mi) The other congruences (10-14) fellow by similar arguments. ANALYSIS OF CONGRUENCES 247 The example used by Sun-Tse corresponds to the three con- gruences x s 2 (mod 3), x = 3 (mod 5), x = 2 (mod 7) Here ilf = 105 and ^ = 35 , ^ = 21, *-16 mi m2 W3 The set of linear congruences 35&i s 1 (mod 3), 216 2 = 1 (mod 5), 156 3 = 1 (mod 7) has the solutions 61 =2, 62 = 1, h = 1 so that one finds, according to (10-21), x = 2 • 2 • 35 + 3 • 1 • 21 + 2 • 1 • 15 = 233 (mod 105) or x = 23 (mod 105) Congruences represent a very convenient tool in many calendar questions, such as determination of Easter dates, the day of the week of a particular date, and so on. Gauss illustrates the Chinese remainder theorem on a problem to find the years that have a certain period number with respect to the solar and lunar cycle and the Roman indiction. Similar problems with respect to the planetary cycles occur earlier by Brahmagupta. In the formula (10-21) for the solution of congruences for rela- tively prime moduls, the multipliers h M ra t - depend only on the numbers m{. If, therefore, one has to solve several sets of congruences, all with the same moduls, the ex- pression (10-21) is particularly convenient since one need not recalculate the multipliers for each set. As an example, let us take a play problem Leonardo discusses in the Liber abaci. A person is requested to think of some number. 248 NUMBER THEORY AND ITS HISTORY Then he is asked what the remainders of the number are when it is divided by 5, 7, and 9, and on the basis of this information the number is divined. Let us denote the unknown number by x and the three re- mainders by a\, a 2 , and a 3 so that x = oi (mod 5), x = a 2 (mod 7), x = a 3 (mod 9) The moduls are relatively prime, and one has M = 5-7-9 = 315 M „ M Ar M oc — = 63, — = 45, — = 35 mi ra 2 m 3 The linear congruences 63&! = 1 (mod 5), 456 2 = 1 (mod 7), 356 3 = 1 (mod 9) have the solutions b x =2, 6 2 = 5, b 3 = 8 so that the Chinese remainder formula (10-21) yields x = 126a! + 225a 2 + 280a 3 (mod 315) From this expression one obtains x, according to the remainders a>\, a<2, «3 indicated. Only when the number is required to be less than 315 is there a unique solution. We conclude these investigations with a remark that will be applied later. Let us suppose that in solving a problem for a modul mi the number x to be determined has Si admissible values x = ai, a 2 , • • • , a Sl (mod Wi) Similarly for the modul m 2 there are s 2 values x = 61, 6 2 , • • • , b S2 (mod m 2 ) When wi and m 2 are relatively prime, each value a* (mod mi) may be combined with an arbitrary value bj (mod m 2 ) so that there exists a total of S1S2 admissible values (mod mim 2 ). In general, one sees that if there are r moduls mi, m2, . . . , m r , all relatively ANALYSIS OF CONGRUENCES 249 prime, and si,S2, . . . , s r possible values for x for each modul, there will be S\S2 ' • ' s r possible values for x for the product modul wiiw 2 • • • m T . Problems. 1. The basket of eggs problem is often given in the form: When the eggs are taken out 2, 3, 4, 5, 6 at a time, there remain respectively 1, 2, 3, 4, 5 eggs, while the number comes out even when they are taken out seven at a time. Find the smallest number of eggs there could have been in the basket. Brah- magupta discusses such a problem and makes the comment that it is a popular one. 2. Ancient Chinese problem. Three farmers divide equally the rice they have raised in common. They went to different markets where various basic weights were used, at one place 83 pounds, at another 110 pounds, and at the third 135 pounds. Each sold as much as he could in full measures, and when they came home one had 32 pounds left, another 70 pounds, and the third 30 pounds. How much rice had they raised together? 3. Ancient Chinese problem. Four labor gangs take over the construction of a dam, each contracting to take the same total number of workdays. The first gang consists of two men, the second has three, the third six, and the fourth twelve men. They complete their work as far as possible in full work by each gang, and then there remains one workday for one man for the first gang, two for the second, and five for the third and fourth. How many work- days did the whole project involve? 4. Regiomontanus. Find a number such that x = 3 (mod 10), x = 11 (mod 13), x = 15 (mod 17) 5. Euler. Find a number such that x = 3 (mod 11), x s 5 (mod 19), x = 10 (mod 29) 10-4. Further study of algebraic congruences. The methods we have just developed for simultaneous congruences may be applied to find the solutions of several algebraic congruences. If, for instance, one has two congruences f(x) = (mod m), g(x) = (mod n) and one wishes to find those x's which satisfy both at the same time, each congruence may be solved separately, and the two sets of roots for the moduls m and n may be combined as simultaneous congruences. 250 NUMBER THEORY AND ITS HISTORY Example. 1. Let us take x 3 - 2x + 3 = (mod 7) 2x 2 = 3 (mod 15) The first congruence is found to have a single solution x = 2 (mod 7) whila ths second has two solutions x = ±3 (mod 15) The simultaneous congruences x = 2 (mod 7), x = 3 (mod 15) give x a 93 (mod 105) for the common solution of the two given congruences, and similarly another solution x = 72 (mod 105) is obtained from x = 2 (mod 7), x = -3 (mod 15) 2. We wish to find some x such that 12x = 3 (mod 15), lOx = 14 (mod 8) The first congruence, according to the theory of linear congruences, has the three solutions x = 4, x = 9, x = 14 (mod 15) while the second has two solutions 3 = 3, x S3 7 (mod 8) When these are combined, one obtains six solutions x a 19, x = 79 x = 39, x = 99 (mod 120) x = 59, x = 119 satisfying both congruences for the l.c.m. of the moduls. By means of the results for simultaneous congruences, one can reduce the solution of an algebraic congruence to the case where the modul is a power of a prime. Let m be some number and m = pi ai p r ar ANALYSIS OF CONGRUENCES 251 its factorization into prime factors. An algebraic congruence fix) = (mod m) (10-22) will hold only for those x's that at the same time satisfy each of the congruences f(x) = (mod Pi ai ) i = 1, 2, • • • , r (10-23) To solve the congruence (10-22) we can therefore determine the solutions of each congruence (10-23) separately and use the Chinese remainder theorem to obtain the values that satisfy them simultaneously. Examples. 1. Let us take the congruence a; 3 - 7x 2 + 4 = (mod 88) Since 8 and 11 are the prime powers in the modul 88, we solve the congruence (mod 8) and (mod 11). In the first case one obtains three solutions x = 2, x=3, x = 6 (mod 8) and in the second case there is a single solution x = 4 (mod 11) When these solutions are combined, one finds three solutions x ss 23, x s= 50, x = 70 (mod 88) of the original congruence. 2. Let us take 5x 2 + 1 = (mod 189) Here 189 = 3 3 • 7 so that we solve the congruence (mod 3 3 ) and (mod 7). One finds, respec- tively, x = ±4 (mod 27), x = ±2 (mod 7) and the combination of these gives four solutions of the given congruence x = ±23, x s ±58 (mod 189) We have just seen how the solution of general algebraic con- gruences may be derived from congruences with a prime-power 252 NUMBER THEORY AND ITS HISTORY modulus. One can go one step further and give a method to solve congruences for prime-power moduls by means of congruences for a prime modul. We shall make the procedure clear on two ex- amples. Examples. 1. Let us first consider the congruence fix) = x 2 - 7x + 2 e= (mod 5) (10-24) By trial one finds the solutions x = 3 and x = — 1 (mod 5) (10-25) In the second step we take the same congruence (10-24) for the modulus 25 fix) = x 2 - 7x + 2 = (mod 5 2 ) (10-26) It is clear that a solution of this congruence must be found among the numbers (10-25) so that we can put x = 3 + 5t or x = —1 + 5u (10-27) To determine t and u we obtain from (10-26) by substitution of these values respectively f{x) = -10 - 5t + 25t 2 = (mod 25) f(x) = 10 - 45m + 25u 2 = and this reduces to t s= —2, u = -2 (mod 5) Therefore, according to (10-27), we can write t = -2 + 5s, x = -7 + 25s (10-28) u = — 2 + 5v, x = — 11 + 25v so that the only solutions of the congruence (10-28) are x = — 7, x = - 11 (mod 25) In the third step we take the congruence (10-24) for a modul that is the third power of 5 fix) = x 2 - 7x + 2 = (mod 125) (10-23) The solutions x must be of the form (10-28), and when they are substituted, one obtains fix) = 100 - 525s -4- 625s 2 = (mod 125) fix) = 200 - 725» + 625y 2 = ANALYSIS OF CONGRUENCES 253 as the conditions s and v must satisfy. This reduces to s = 4, v = 2 (mod 5) and it follows that x = 93, x s 39 (mod 125) are the only solutions of the congruence (10-29). The same process may be repeated indefinitely to obtain the solutions for moduls that are arbitrarily high powers of 5. 2. We begin by observing that the congruence fix) = x z - Sx 2 + 21s - 11 s (mod 7) (10-30) has the two solutions x 35 2, x = 3 (mod 7) To find the solution of the congruence f(x) = x 3 - Sx 2 + 21s - 11 = (mod 7 2 ) (10-31) we have to substitute x = 2 + It, x = 3 + 7s (10-32) respectively. By the substitution of the second expression into (10-31), the condition reduces to the impossible congruence 7=0 (mod 49) so that we find no s that will give an x satisfying (10-31). When the first expression (10-32) is substituted, the congruence reduces to t = -1 (mod 7) and correspondingly, x = —5 (mod 49) is the only solution of (10-31). When this method is applied to the same congruence (10-30) (mod 7 3 ), one finds a single solution x = 93 (mod 343) We shall conclude this study of algebraic congruences by es- tablishing a few results that extend the analogies between equations and congruences. The first is: Theorem 10-6. When an algebraic congruence of degree n fix) = (mod m) has a solution x = a,\ (mod m) 254 NUMBER THEORY AND ITS HISTORY then one can write S(x) = (x - ai)A(x) (modm) (10-33) where Si (x) is a polynomial of degree n — 1. To prove the theorem we divide /(a;) by x — a x and find Six) = (x- ai )Si(x) + R where R is some integer and the degree of Si (x) is one less than the degree of /Or). By putting x = a\ in this identity, we obtain /(ai) = R = (mod m) so that the congruence (10-33) follows. Examples. 1. Let us take the third-degree congruence /(x) = x 3 - 7x 2 + 4 e= (mod 88) We have already found that this congruence has three solutions x = 26, x = 59, x = 70 (mod 88) The division of /(x) by x — 26 yields x 3 - 7x 2 + 4 = (x - 26) (x 2 + 19x + 494) + 12,848 and since 12,848 is divisible by 88, one has x 3 - 7x 2 + 4 = (x - 26) (x 2 + 19x + 494) (mod 88) The reader may determine the corresponding decompositions for the other roots of the congruence. 2. In the example of second degree Six) = 3x 2 + 7x - 2 = (mod 23) one finds the root x = 3 (mod 23) and the decomposition 3x 2 + 7x - 2 = (x - 3)(3x + 16) (mod 23) The remaining two theorems, it should be noted, hold only for congruences for a prime modul. ANALYSIS OF CONGRUENCES 255 Theorem 10-7. When the congruence f(x) = (mod p) (10-34) of nth degree for a prime modul p has r different roots x = a-i, x = a 2 , - • • , x = a r (mod p) one can write f(x) = (x - a\)(x - a 2 ) - • • (x — a r )f r {x) (mod p) (10-35) where f r (x) is a polynomial of degree n — r. The proof is based upon theorem 10-6, which shows first that one can write f(x) = (x- aJMx) (mod p) (10-36) where /i (x) is of degree n — 1 . But since a 2 is also a root of (10-34), we must have f(a 2 ) = (a 2 - Oi)/i(a 2 ) = (mod p) Here we use the fact that when a prime divides a product it must divide one of the factors. The difference a 2 — a\ is not divisible by p since a\ and a 2 were different roots, so that we conclude /i (02) = (mod p) According to theorem 10 -6 we can write again fi(x) = (x - a 2 )f 2 (x) (mod p) where f 2 (x) is of degree n — 2; hence from (10-36) f(x) = (x - a x ) (x - a 2 )f 2 (x) (mod p) For the third root a 3 of (10-34), one finds /(a 3 ) = (o 3 - «i) a 3 - a 2 )/ 2 (a 3 ) = (mod p) and one concludes similarly that / 2 (a 3 ) = (modp) This gives f 2 (x) = (x - a 3 )f 3 (x) (mod p) 256 NUMBER THEORY AND ITS HISTORY where f 3 (x) is of degree n — 3, and f(x) = (x - ai)(x - a 2 )(x - a 3 )f 3 (x) (modp) The process may be continued until one arrives at the general decomposition (10-35). Examples. 1. In the congruence of fourth degree x 4 - 5x 3 - 5x - 1 = (mod 7) we have the roots x = 2, x = 3 (mod 7) and corespondingly the decomposition x 4 - 5x 3 - 5x - 1 = (x - 2)(x - 3)(x 2 + 1) (mod 7) 2. The congruence x 4 - 1 = (mod 5) has the roots x = 1, x = 2, x = 3, x = 4, (mod 5) and therefore x 4 - 1 = (x - l)(x - 2)(x - 3)(x - 4) (mod 5) 3. The congruence 3x 2 + 1 = (mod 19) has the solutions x == ±5 (mod 19) and correspondingly one finds 3x 2 + 1 s 3(x - 5)(x + 5) (mod 19) Our last result is due to the French mathematician Lagrange (1768), as Gauss observes in this connection in the Disquisitiones. Lagrange, of course, does not use the congruence terminology but the content of his theorem is as follows: Theorem 10-8. A congruence f(x) = (mod p) ANALYSIS OF CONGRUENCES 257 for a prime modul p cannot have more different solutions than its degree, except in the trivial case where all coefficients in f{x) are divisible by p. Let us suppose that the degree of /(#) is n and that x = ai, x = a 2 , . . . , x = a n (mod p) are n different solutions of the congruence. From theorem 10-7 we conclude that fix) = (x — ax){x — a 2 ) • • • (x — a n )F (mod p) where F is of zero degree, hence some integer. If there were some further solution x = a n+ i (mod p) we would have f(a n+ i) =s (a n+1 - ax) • • • (a w+1 - a n )^ = (mod p) Here none of the differences a n+ i — a; are divisible by p since we deal with different solutions (mod p). The conclusion is that F = (mod p) and therefore identically f(x) = (mod p) which means that all coefficients mf(x) are divisible by p. Problems. 1. Find the common solutions to the congruences (a) 3x 2 - 7 s (mod 17) 5x 2 - 2z - 3 = (mod 12) (6) 3x == 11 (mod 23) 50x s 2 (mod 32) (c) x 2 + 5 = (mod 27) 3x + 1 = (mod 10) 258 NUMBER THEORY AND ITS HISTORY 2. Solve the congruences (o) x 3 - 3x - 8 = (mod 60) (6) x 2 + 11 = (mod 180) (c) x 2 + 2x + 7 = (mod 75) 3. Solve the following congruences and find the corresponding congruence factorizations: (a) x % - x 2 - 2x s (mod 5) (6) x 3 + x 2 - 2 s (mod 5) (c) x 2 + 1 s (mod 13) 4. Solve the congruences in problem 3 for the second and third powers of the moduls. CHAPTER 11 WILSON'S THEOREM AND ITS CONSEQUENCES 11-1. Wilson's theorem. In the Meditationes Algebraicae by Edward Waring, published in Cambridge in 1770, one finds, as we have already mentioned, several announcements on the theory of numbers. One of them is the following: For any prime p the quotient 1-2 (p - 1) + 1 V is an integer. This result Waring ascribes to one of his pupils John Wilson (1741-1793). Wilson was a senior wrangler at Cambridge and left the field of mathematics quite early to study law. Later he became a judge and was knighted. Waring gives no proof of Wilson's theorem until the third edition of his Meditationes, which appeared in 1782. Wilson probably arrived at the result through numerical computations. Among the posthumous papers of Leibniz there were later found similar calculations on the re- mainders of n\, and he seems to have made the same conjecture. The first proof of the theorem of Wilson was given by J. L. La- grange in a treatise that appeared in 1770. We shall prefer to give Wilson's theorem in the now usual con- gruence form: Theorem 11-1. For any prime p one has (p _ i)! = -1 (mod p) (11-1) The theorem is easily verified for small values of p. 11 = -1 (mod 2), 2! s -1 (mod 3), 4! s -1 (mod 5) 259 260 NUMBER THEORY AND ITS HISTORY Before we proceed to the general proof we shall indicate its main idea in the special case p — 19. For this modulus one has the congruences 2 • 10 = 1, 7 • 11 = 1 3 • 13 = 1, 8 • 12 = 1 4-5=1, 9 • 17 = 1 6 • 16 = 1, 14 • 15 = 1 and also 1 = 1, 18 • 18 s 1 When the first group of congruences is multiplied together and the numbers rearranged, it follows that 2-3 16 • 17 = 1 (mod 19) This congruence is multiplied by 18 s= - 1 (mod 19) and we obtain 18! s -1 (mod 19) as required by Wilson's theorem. The proof in the general case proceeds along the same lines. Let p be some prime and a one of the numbers 1, 2, . . . , p - 1 (11-2) The linear congruence ax = 1 (mod p) as we have seen, has a single solution x = b (mod p) In this manner there corresponds to every a in (11-2) a unique b, such that ab = 1 (mod p) and clearly b corresponds to a in the same way. This shows that the numbers in (11-2) can be divided into pairs a, b whose product WILSON'S THEOREM AND ITS CONSEQUENCES 261 is congruent to 1 (mod p). The two numbers in a pair x, x can only be equal when x 2 = 1 (mod p) This can be written (x - l)(x+ 1) = (modp) so that it can occur only when x = 1 (mod p) or #=— 1 = p — 1 (mod p) that is, when x=lorx = p— 1. In multiplying the numbers (11-2) together to form (p — 1)!, the pairs with different a and b will give products congruent to 1 (mod p), while the two re- maining factors 1 and p — 1 have a product that is congruent to — 1. This completes the proof of Wilson's congruence (11-1). One may ask what happens for other moduls. One computes easily 1! = -1 (mod 2), 6! = -1 (mod 7) 2!=-l (mod 3), 7!- (mod 8) 3!= 2 (mod 4), 8!= (mod 9) 4! = -1 (mod 5), 9! = (mod 10) 5! = (mod 6), 10! = -1 (mod 11) The general result is: Theorem 11-2. For a composite number n one has (n - 1)! = (modn) except when n — 4. The proof is quite simple. Let us write n — pq where p is a prime. If p is not equal to q, both p and q occur as factors in the product (n — 1) ! so that it is divisible by n. When 262 NUMBER THEORY AND ITS HISTORY p — q and n — p 2 , the factors p and 2p occur in (n — 1 ) !, provided p > 2. In the remaining case when p = 2, n = 4, there is an exception to the rule, as we found above. Theorem 11-2 shows that Wilson's congruence (11-1) will hold for the primes and for no other numbers. We shall deduce certain consequences from Wilson's congruence. In the product (p- i)! = i.2 — ^• E y J: <p-2)<p-i) one has the following congruences: p- 1= -1, p-2 = -2, ..., p + 1 _ p - 1 (mod p) 2 2 for the series of factors. Consequently 2i±( P - lV (p- 1)!=. (-1) 2 (^1-2 ^-j (modp) and when this is substituted in Wilson's congruence, one finds (i • 2 nr 1 ) 2 s ( ~ 1} ^" (mod p) (11_3) Let us discuss this result a little further. When p is a prime of the form 4n + 1, (-1) 2 = (_l)2n+l = _l so that (11-3) takes the form (l • 2 E -^ L ) + X s ° ( mod P) and we can state: Theorem 11-3. When p is a prime of the form 4n + 1, the congruence x 2 + 1 = (mod p) WILSON'S THEOREM AND ITS CONSEQUENCES 263 is solvable and has the roots x s ± \^—£- ) ! ( mod V) For instance when p = 13 we find 6! = 5 (mod 13) and 5 2 + 1 = (mod 13) In the second case when p is a prime of the form An + 3, the congruence (11-3) reduces to (i • 2 ^T/ ~ l ~ ° (mod p) This may be written and one concludes: Theorem 11-4. For any prime p of the form An + 3, one has one of the congruences (<Hr) ! = ± 1 (mod p) (11-4) One finds for the lowest primes 1! = 1 (mod 3), 3! = -1 (mod 7), 5! = -1 (mod 11) 9! == _i ( m od 19), 11! s 1 (mod 23) There exists a complicated rule determining whether one shall use +1 or -1 in the congruence (11-4). 11-2. Gauss's generalization of Wilson's theorem. In the third section of the Disquisitiones Gauss indicates, without giving the details of the proof, how the theorem of Wilson can be extended 264 NUMBER THEORY AND ITS HISTORY to arbitrary moduls. Before we proceed to this theorem, it is necessary to carry through a certain auxiliary investigation. We wish to determine the number of solutions of the congruence x 2 s 1 (mod m) (11-5) for a given modul m. As we have already observed previously, we can solve the congruence first for prime-power moduls and then obtain the solution for a general modul by the Chinese remainder theorem. Therefore, let p be a prime and let us study the con- gruence x 2 = 1 (mod p a ) (11-6) This may be written (x - l)(x + 1) = (mod p a ) (11-7) If p > 2, only one of these factors can be divisible by p so that one has either x = 1 (mod p a ) or x = — 1 (mod p a ) and we conclude: For a prime p > 2, the congruence (11-6) has two solutions x = ±1 (mod p a ) The case when p = 2 is slightly more complicated. For a = 1 in (11-6), the congruence becomes x 2 = 1 (mod 2) which has a single solution x = 1 (mod 2). For a = 2, the con- gruence x 2 5= 1 (mod 4) has two solutions # = ±1 (mod 4). Finally let a > 2. If one of the factors in (11-7) is divisible by 2, so is the other, but only one of them can be divisible by 4 or a higher power of 2. If x + 1 is divisible only by 2 to the first power, one must have x = 1 (mod 2" -1 ) WILSON'S THEOREM AND ITS CONSEQUENCES 265 and this represents two different solutions x = 1, isl+ 2"- 1 (mod 2 a ) of the original congruence. Similarly when x — 1 contains only the first power of 2, one finds the solutions x = -1, a; = -1 - 2 a_1 (mod 2 a ) The four solutions are different (mod 2 a ), as one easily checks. To sum up, for p = 2, the congruence (11-6) has four solutions x= ±1, x=±(l + 2"" 1 ) (mod 2 a ) except when a = 2, when there are two solutions x = ± 1 (mod 4) and when a = 1, when there is a single solution x = 1 (mod 2) It remains to determine the number of solutions of the general congruence (11-5). We decompose the modul into its prime factors m = 2 a p/ 1 • • • p/ r (11-8) and solve the congruence (11-6) for the moduls 2 a and pf\ The Chinese remainder theorem shows that the solutions of (11-5) are obtained by selecting a particular solution for each of the prime powers and combining them by simultaneous congruences. When m is not divisible by 2, hence when a = 0, each of the congruences (mod pt^) has 2 roots so that we obtain a total of 2 T solutions. When a = 1 the congruence (mod 2) has a single solution so that there will still be 2 r solutions. When a = 2 the congruence (mod 4) has two solutions, and the total number in this case is 2 r+1 . Finally, when a > 2, the congruence (mod 2") has four solutions so that the total number of solutions of (11-5) is 2 r+2 . Thus we can state: Theorem 11-5. The congruence x 2 = 1 (mod m) 266 NUMBER THEORY AND ITS HISTORY where the modul has the prime decomposition m =* 2°7> 1 /31 • • • pf 7 will have 2 r solutions when a = or a = 1 2 r+1 solutions when a = 2 2 r+2 solutions when a > 2 This completes our preparations for Gauss's generalization of Wilson's theorem: Theorem 11-6. If one forms the product P of the remainders relatively prime to the number to, then P s= ±1 (mod to) (11-9) In this congruence one has the value +1 in all cases, with the following exceptions where —1 appears: 1. to — 4. 2. to = p@ is a power of an odd prime. 3. m = 2pP is twice the power of an odd prime. When to = 2 it is immaterial whether one uses +1 or — 1. The result, as one sees, implies Wilson's theorem. For the smallest composite moduls one finds 1 • 3 = - 1 (mod 4), l-2-4-5-7-8=-l (mod 9) 1 • 5 = -1 (mod 6), 1 • 3 • 7 • 9 = -1 (mod 10) 1 • 3 • 5 • 7 s= l (mod 8), 1 • 5 • 7 • 11 = 1 (mod 12) The proof is based on the same principle as our proof of Wilson's theorem. The set of all positive integers less than and relatively prime to to are paired as before. To each such number a one can find a unique b for which ab = 1 (mod to) WILSON'S THEOREM AND ITS CONSEQUENCES 267 Let us suppose first that a and b are different. Then in computing the remainder of the product P in (11-9), they may be disregarded since their product is congruent to 1 (mod m). In P, therefore, we need only to consider the product of those numbers a that belong to a pair a, a with equal components, i.e., the solutions of the congruence x 2 = 1 (mod m) (11-10) If a is a solution of this congruence, so is — a and these two numbers represent different remainders (mod m) since a = —a (mod m) can only occur in the trivial case m = 2. In forming the remainder of the product P, we multiply a and —a and note that a(—a) = —a 2 = —1 (mod m) Each pair of roots a and —a therefore contributes a factor — 1 to the remainder of P (mod m) and the congruence (11-9) follows. The remainder + 1 must be used when there is an even set of roots a and —a, hence when the number of roots of (11-10) is divisible by 4; otherwise one must use — 1. But in theorem 11-5 this number of roots has been determined, and one verifies that the only cases in which it is not divisible by 4 are exactly those that have been enumerated above in Gauss's theorem. We notice further, according to theorem 11-5, that the integers m for which the negative sign must be used in (11-9) are those for which the congruence x 2 ss 1 (mod m) has only two solutions and clearly these must be x = ±1 (mod m) Problems. Check the theorem of Gauss for the composite numbers below 25. 11-3. Representations of numbers as the sum of two squares. We have already mentioned certain results regarding the repre- sentation of numbers as the sum of two squares, both in discussing 268 NUMBER THEORY AND ITS HISTORY Fermat's notes on Diophantos and in connection with the factori- zation of numbers. We are now ready to give the proofs for some of the basic facts. There are numerous ways in which this theory may be treated. We shall prefer a method based on a simple theorem on congruences given by the Norwegian mathematician Axel Thue (1863-1922), who is known for his important contri- butions to the newer theory of Diophantine equations. The theorem of Thue is of interest also because it gives a simple application of a mathematical method known as Dirichlet's box principle: If one has n boxes and more than n objects to distribute in them, at least one of the boxes must contain more than one object. This statement sounds extremely trivial, but, neverthless, it has important applications to various questions in number theory. The theorem of Thue that we wish to prove is the following: Theorem 11-7. Let p be a prime and k the least integer greater than Vp. Then for any integer a not divisible by p, one can find numbers x and y belonging to the set 1, 2, . . . , k — 1 such that xa = ±y (mod p) (11-11) Before we proceed to the proof, let us take as an example the case where p = 23 and k = 5. For a — 9 and a = 10 one finds, respectively, 3a = 4, 2a = -3 (mod 23) The reader may give a complete set of such congruences for all remainders a (mod 23). To prove the theorem let us take all numbers ax — y, x, y — 0, 1, • • •, k — 1 (11-12) and classify them according to their remainders (mod p). There are altogether k 2 > p such numbers (11-12), so that according to Dirichlet's box principle at least two of them must have the same remainder, hence be congruent (mod p). Let us suppose that ax\ — Vi = a%2 — 2/2 (mod p) or a(xt - x 2 ) = y\ - y 2 (mod p) (11-43) WILSON'S THEOREM AND ITS CONSEQUENCES 269 The absolute values of the differences xi - x 2 , 2/1-2/2 again belong to the set 0, 1, 2, . . . , k — 1. But the value is excluded, because, for instance, y x = y 2 would involve, according to (11-13), a(xi — x 2 ) = (mod p) from which one concludes that x x = x 2 , consequently x x = x 2 , contrary to the assumption that we are dealing with two different numbers in (11-12). In (11-13) we have, therefore, a congruence of the desired form (11-11) when one, if necessary, adjusts the sign so that the coefficient of a is positive. In the next step we show: Theorem 11-8. A prime p is representable as the sum of two squares if the congruence a 2 + 1 = (mod p) (11-14) is solvable. To prove this result we take a solution a of the congruence (11-14) and determine the two numbers x and y according to theorem 11-7. We multiply the congruence (11-14) by x 2 and obtain x 2 a 2 + x 2 s= y 2 + x 2 = (mod p) so that x 2 + y 2 = tp (11-15) for some suitable positive integer t. But x and y were chosen such that x 2 S (k - l) 2 < p, y 2 ^ (k- l) 2 < p and we conclude from (11-15) pt < p + p = 2p or t < 2. The only possibility is, therefore, t = 1 and p = x 2 + y 2 is the desired representation of p as the sum of two squares. 270 NUMBER THEORY AND ITS HISTORY When theorem 11-8 is combined with theorem 11-3 we arrive at the key result: Theorem 11-9. Any prime of the form 4w + 1 can be repre- sented as the sum of two squares. The prime 2 is evidently the sum of two squares, but no prime of the form An -\- 3 can be the sum of two squares, because such a sum is never of the form 4n + 3, a fact we have already mentioned in Chap. 4 in connection with the factorization method based on the representation of a number as a sum of two squares. At that time we also showed that a prime can have but a single such representation, and we gave the representation of all primes below 100 as the sum of two squares. Extensive tables of this kind have been computed. Theorem 11-10. Let JV be a positive integer and n 2 its greatest square factor so that N = N n 2 The necessary and sufficient condition for N to be representable as the sum of two squares is that N contain no prime factors of the form An + 3. In Chap. 8-5 in discussing Fermat's notes on Diophantos's Arith- metics, we proved that on the basis of theorem 11-9 it follows that N can be represented as the sum of two squares provided the prime factors of iVo were 2 or of the form An + 1. There remains, after what we have just said, only to prove that if No has a prime factor p = An + 3, no representation of N as the sum of two squares can exist. This we achieve by showing that a decomposition N = x 2 + y 2 (11-16) must lead to a contradiction. Let us suppose that in (11-16) the greatest common divisor of x and y is d so that x — dx\, y — dy\ We divide (11-16) by d 2 and find ?L = f 2 N = x 1 2 + y 1 2 (H-17) d d WILSON'S THEOREM AND ITS CONSEQUENCES 271 where d 2 must divide n 2 , and x\ and y x are relatively prime. Since No is divisible by po, we obtain from (11-17) the congruence xi 2 + Vx = (mod po) (11-18) One of the numbers x\ and ?/i, for instance X\, is not divisible by po, so that we can find some z such that X\Z = 1 (mod po) When (11-18) is multiplied by z 2 , it follows that ( Vl z) 2 +1^0 (mod po) This, however, according to theorem 11-8, would show that p must be the sum of two squares, notwithstanding the fact that it is a prime of the form 4w + 3. We have therefore established the impossibility of a representation (11-16). Problem. Represent all primes of the form 4n + 1 between 500 and 600 as the sum of two squares. CHAPTER 12 EULER'S THEOREM AND ITS CONSEQUENCES 12-1. Euler's theorem. In a letter to Frenicle de Bessy dated October 18, 1640, Fermat writes as follows: It seems to me after this that I should tell you the foundation on which I support the demonstrations of all which concerns geometric progressions, namely: Every prime number measures [divides] infallibly one of the powers minus unity in any progression, and the exponent of this power is a divisor of the given prime number minus one; and after one has found the first power which satisfies the condition, all those whose exponents are multiples of the first satisfy the condition. Fermat uses the example of the powers of three 1, 2, 3, 4, 5, 6 3, 9, 27, 81, 243, 729 where the first line gives the exponents. He points out that 3 3 — 1 is the first such expression that is divisible by 13 and that the exponent 3 divides 13 — 1 = 12 so that 3 12 — 1 is divisible by 13. Fermat continues: "And this proposition is generally true for all series and all prime numbers. I would send you the demon- stration, if I did not fear it being too long." Unfortunately Fermat 's correspondents never seemed particu- larly interested in demanding information about proofs for his results. In congruence terminology Fermat states that for any number a and any prime p, there exists some smallest exponent d such that a d - 1 s (mod p) 272 EULER'S THEOREM AND ITS CONSEQUENCES 273 and d divides p — 1, hence a P-i _ i = o (mod p) It should be observed that in this theorem one must place the obvious restriction that a shall not be divisible by p. For this result, as well as for several other of Fermat's theorems, Euler was the first to publish a proof; it appeared in the Proceed- ings of the St. Petersburg Academy in 1736. Considerably later (1760), Euler gave a more general theorem of the same kind, which we shall prefer to deduce first and then let Fermat's theorem follow as a special case. To formulate Euler's theorem we first recall the definition of Euler's ^-function, which we studied in Chap. 5. For any positive integer m we denoted by <p(m) the number of remainders from 1 to w that were relatively prime to m. For this function of m, we found the expression , (B) _ B (l-I)...(l-I) (12-1) where p\, p 2 , • • • , Pr are the different primes dividing m. Euler's theorem is then: Theorem 12-1. For any number a that is relatively prime to m one has the congruence a <f(rn) ^ 1 ( mod m ) ( 12 -2) Before we proceed to the proof let us consider some examples. Examples. 1. Let to = 60 and a = 23. One finds *(60) = 60(1 -i)(l - i)d - i) = 16 and to verify the congruence (12-2) we compute for the modulus 60 23 2 = -11 23 4 s 121 a 1 23 16 = 1 274 NUMBER THEORY AND ITS HISTORY 2. Let us take m = 11 and o = 2, hence *(11) = 11(1 -tV) = 10 We have 2 6 = 32 s -1 2 10 & 1 (mod 11) To prove Euler's congruence (12-2) we denote the <p(m) re- mainders less than and relatively prime to m by n, r 2 , . . . , Mm) (12-3) We multiply each of them by the given number a relatively prime to m and divide each product by w: r { a — qm + r\ (12-4) where r\ is the least positive remainder. Here r\ must be rela- tively prime to m because in (12-4) a common factor of m and r[ would divide r^a and this is impossible, since r* and a are both relatively prime to m. The number r< is, therefore, also one of the remainders (12-3). We shall prefer to write the relations (12^4) as congruences na = r'i (mod m) (12-5) Two different remainders r t - and ry in (12-3) cannot give rise to the same r\ in (12-5) because the congruence na = Tjd (mod m) implies, since a may be canceled, that Ti = rj (mod m) or n = rj. We conclude that in (12-5) the remainders r* and r£ both run through the whole set (12-3). Let us illustrate the situation on the example where m = 20 and a = 7. Here <p(20) =20(l-J)(l--fr) =8 EULER'S THEOREM AND ITS CONSEQUENCES 275 and the relatively prime residues are the eight numbers 1, 3, 7, 9, 11, 13, 17, 19 One finds la = 7, 11a s 17 " ' X ' 13a " U (mod 20) 7a s 9, 17a = 19 9a = 3, 19a = 13 When all these congruences are multiplied together, one obtains a 8 • 1 • 3 • 7 • 9 • 11 • 13 • 17 • 19 = 1-3 -7 -9 -11 -13 -17 -19 (mod 20) The product of the remainders is relatively prime to the modul and so may be canceled to give a 8 = 1 (mod 20) The general proof is quite analogous. We multiply all <p(m) congruences (12-5) and find a v(m) rir 2 • • • r , (TO) s r[r' 2 • • • r' v(m) (mod to) (12-6) Since the numbers n and r< form the set (12-3) of remainders, their products are equal. Furthermore, the r/s are relatively prime to to so that in (12-6) the product can be canceled and there remains Euler's congruence (12-2). The subsequent sections are all based on Euler's congruence. At this point we shall mention only one minor application to our familiar problem of solving linear congruences, or equivalently, linear indeterminate equations. Theorem 12-2. When a and to are relatively prime, the solu- tion of the linear congruence ax = b (mod w) (12-7) is given by the formula x = ba* (m)-1 (mod to) (12-8) 276 NUMBER THEORY AND ITS HISTORY For the proof we multiply both sides of the congruence (12-7) by a <p{ - m) ~ 1 and find from Euler's congruence €^ m) x = x = bo?^' 1 (mod m) Examples. 1. In the congruence 7x = 5 (mod 24) we have <p(24) = 8 and therefore according to (12-8) x = 5 ■ 7 7 (mod 24) To compute the smallest remainder of x we notice that 7 2 = lf 7 6 = lf 7 7 = 7 (mod 24) and x = 5 ■ 7 = 11 (mod 24) 2. Let us take the congruence Ux = 9 (mod 20) Here <p(29) = 28 so that x a 9 • ll 27 (mod 29) One computes 11 2 = 5 11* = 25 s -4 lis s 16 (mod 29) ll 16 = 256 s -5 ll 27 = ll 16 • ll 8 • ll 2 • 11 s (-5) • 16 • 5 • 11 = 8 and x s 9 • 8 = 14 (mod 29) The formula (12-8) is interesting because it gives the solution of the linear congruence in explicit form. However, for con- gruences that involve fairly large numbers, one finds that in regard to simplicity of computations it is definitely inferior to our previous method based on the linear indeterminate equations. EULER'S THEOREM AND ITS CONSEQUENCES 277 Problems. 1. Verify Euler's congruence in the following examples: to = 81, a — 5 to = 120, a = 7, o = 19 to = 59, a = 2 2. Solve the following congruences by Euler's theorem: 7x = 2 (mod 24) 4x = 3 (mod 49) 17a; = 41 (mod 620) 3. Compare the work involved by solving the congruence 311a; m 19 (mod 203) by Euler's theorem and by linear indeterminate equations. 12-2. Fermat's theorem. The theorem of Euler will now be applied to certain important special cases. We assume first that the modul m — p a is a power of a prime. Then <p(m) = p a (l --) = p a - <p a - y and the numbers relatively prime to m are those that are not divisible by p. Euler's theorem states therefore: Theorem 12-3. If the number a is not divisible by the prime p, one has a p a -p a - 1 = i ( m od p a ) (12-9) By specializing further to the case where the modul m = p is a prime, we arrive at Fermat's original theorem: Theorem 12-4. When p is a prime and a some number not divisible by p, then aP- 1 = 1 (mod p) (12-10) 278 NUMBER THEORY AND ITS HISTORY As an example, let us take p = 101 and a = 2. One computes 2 4 3 16 2 8 s 256 = 54 2 16 = (54) 2 = - 13 (mod 101) 2 32 = 169 = _33 2 6* = (-33) 2 s -22 and 2 ioo ^ 2 64 . 2 32 , 2 4 s (-22) (-33)16 = 1 (mod 101) According to Fermat's theorem the algebraic congruence x p-i -1=0 (mod p) has the p - 1 different solutions 1, 2, . . . , p - 1. When theorem 10-7 on algebraic congruences is applied to this case, it leads immediately to Theorem 12-5. For any prime modulus p, one has x p-i _ i = (x - i)( x - 2) • • • (x - (p - 1)) (modp) (12-11) For instance when p = 5 (x- l)(x- 2)(x- 3)(x-4) = (z- l)(x-2)(x + 2)(x+l) = (a; 2 - l)(x 2 - 4) = x 4 - 1 (mod 5) When one compares the coefficients of the powers of x on both sides of the congruence (12-11), one obtains various congruences relating to the numbers 1, 2, . . . , p - 1. If we take the constant form in which x does not occur, one has on the left the number — 1 and on the right the product (-l)(-2) • • • [-(p - 1)] = (-l^fo ~ 1)1 so that (-lF^Cp - 1)! = -1 (modp) This, as one sees, is the same as Wilson's congruence. EULER'S THEOREM AND ITS CONSEQUENCES 279 Format's congruence (12-10) holds for all numbers a except those divisible by p. However, it is possible to formulate- this result in such a manner that it is valid for every number without exception. When the congruence (12-10) is multiplied by a, one finds a? = a (mod p) for every a not divisible by p. Clearly this congruence holds also for those a that are divisible by p, since then both sides are divisible by p. Therefore, we can restate Fermat's theorem as follows: Theorem 12-6. For a prime p one has aP = a (mod p) (12-12) for any a. As a minor application of this theorem let us show: Theorem 12-7. In the decadic system a number and its fifth power have the same final digit. In terms of congruences we shall have to establish that a 5 = a (mod 10) for any a. But by Fermat's congruence one has a 5 = a (mod 5) and trivially one finds a b = a (mod 2) Problems. 1. Verify Fermat's congruence (12-10) for p = 71, a = 3, V = 59, a = 2 2. Verify the congruence (12-11) for p = 11 and p = 13. 3. Show that for any number n not divisible by 2 and 3 one has n 2 = 1 (mod 24) 12-3. Exponents of numbers. Euler's theorem shows that to any number a that is relatively prime to the modul m there must exist some exponent n such that a n = 1 (mod m) (12-13) 280 NUMBER THEORY AND ITS HISTORY The least positive exponent n for which this congruence (12-13) holds we shall call the exponent to which a belongs (mod m). For small moduls it may be determined directly by finding the residue (mod m) of the various powers of a. For instance, let m = 30 and a = 7. One finds successively a 2 = -11, a 3 = 13, a 4 = 1 (mod 30) so that 7 belongs to the exponent 4 (mod 30). In connection with the initial statement of his theorem, which we quoted, Fsrmat points out in the example that the number 3 belongs to the exponent 3 (mod 13) and the exponent 3 divides p - 1 = 12. In the study of the properties of the exponents to which a number belongs, wo begin by mentioning : Theorem 12-8. If the number a belongs to the exponent n (mod m) and if N is some other number such that ,iV then n di vides N. We divide N by n ar = I (mod m) (12-14) N = qn + r, ^ r < n and deduce from (12-13) and (12-14) Q N _ aqn +r = (a ny a r ^ ^ ^ j ^ %) Since n was the smallest positive exponent such that the congru- ence (12-13) would hold, we conclude that r = and n divides N. When theorem 12-8 is applied to Euler's congruence, there follows immediately: Theorem 12-9. The exponent n to which a number a belongs (mod m) divides <p(m). This theorem brings up the important question: When a divisor n of <p{m) is given, does there exist some number a belonging to the exponent n (mod m) ? In general this is not true, as one can show by examples. For instance, let us take m = 15 and <p(m) = 8. The numbers that EULER'S THEOREM AND ITS CONSEQUENCES 281 are relatively prime to m are congruent to one of the eight numbers ±1, ±2, ±4, ±7 One finds that all of them satisfy the congruence x 4 = 1 (mod 15) so that there is no number belonging to the exponent n = 8. On the other hand, let us compute the exponents to which the various numbers belong (mod 13). Here «?(13) = 12 and this number has the divisors 1, 2, 3, 4, 6, 12 One verifies that there are numbers belonging to each of these exponents (mod 13), namely: Numbers Exponent Belonging 1 1 2 12 3 3,9 4 5,8 6 4, 10 12 2, 6, 7, 11 This table illustrates the general result : Theorem 12-10. For a prime modul p there exist numbers belonging to every divisor n of p — 1. The proof will be based on the following theorem, which throws light on the interrelation between the numbers that belong to the same exponent. Theorem 12-1 1 . Let a be a number belonging to the exponent n for the prime modul p. Then the powers a n , a r \ ... , o r " n > (12-15) represent all numbers belonging to the same exponent where ri = 1, r 2 , • • • , r, w (12-16) are the positive remainders less than and relatively prime to n. 282 NUMBER THEORY AND ITS HISTORY For instance, in the example above, the number 2 belongs to the exponent n — 12 (mod 13). The remainders less than and relatively prime to 12 are 1, 5, 7, 11 and one finds as in the table that 2, 2 5 = 6, 2 7 = 11, 2 11 = 7, (mod 13) are the numbers belonging to the exponent 12 (mod 13). To prove theorem 12-11 we notice first that a satisfies the con- gruence x n s 1 (mod p) (12-17) But for any i one has («T = (a n y = 1 (mod p) so that the n numbers 1, a, a 2 , ... , a n_1 (12-18) satisfy the same congruence (12-17). Furthermore the n powers (12-18) are incongruent (mod p) because from a congruence a 1 = a } (mod p) would follow a %—j = j (mod p) with a smaller exponent i — j than n. We conclude therefore from the theorem of Lagrange (theorem 10-8) that the numbers (12-18) are all the roots of the congruence (12-17) of nth degree. Consequently, the numbers belonging to the exponent n (mod p) are to be found in (12-18). But all numbers a r — a r , where r has a common factor d with n, must belong to a smaller exponent since n r a r d = (a n )" d = 1 (mod p) As possible numbers belonging to the exponent n there are left only those a r = a r where r is relatively prime to n, that is, where r is one of the remainders (12-16). Let n r be the exponent to EULER'S THEOREM AND ITS CONSEQUENCES 283 which a r belongs (mod p). Since a r is a root of the congruence (12-17), n r must divide n. But conversely from {a r ) nr = 1 (mod p) it follows that n divides r • n r , therefore, since (r,n) = 1, n also divides n r , so that n r = n. Ihis completes the proof of theorem 12-11. The deduction of theorem 12-10 from theorem 12-11 is based on the following reasoning. We denote by m = 1, n 2 , n 3 , • • • , n„ = p - 1 (12-19) the set of all divisors of p - 1, and for any such divisor m let N f be the number of integers belonging to the exponent m (mod p). Since any integer not divisible by p belongs to some exponent (mod p), we must have Nt + AT 2 + N 3 + • • • + N v = p - 1 (12-20) Theorem 12-11 states that for any divisor m we have only two alternatives: either there is no integer belonging to this exponent (mod p) so that N t = 0, or we have Ni = <p(m) where <p is Euler's function. But in discussing Euler's ^-function we derived the theorem (theorem 5-12) that the sum of the ^-functions of the divisors of a number was equal to the number itself. When applied to the divisors (12-19) of p - 1, this gives *>(ni) + *>(n 2 ) H r- v(n,) = p - 1 (12-21) By comparison of (12-20) and (12-21), one sees that both sums cannot have the same value p - 1 except when each N { takes the Value <p(n { ). Thus for every divisor m of p - 1, there exist numbers belonging to it. The proof shows that one can supplement theorem 12-10 as follows: Theorem 12-12. For every divisor n of p - 1, there exist <p(n) numbers belonging to the exponent n for the prime modul p. One may verify this result on the table of exponents (mod 13) given above. 284 NUMBER THEORY AND ITS HISTORY Problems. 1. Find the exponents to which the relatively prime remainders belong for the following moduls: to = 40, to = 30, to = 20, to = 7 2. Check theorem 12-12 on the residues for the following primes: p = 11, p = 17, p = 19 12-4. Primitive roots for primes. The highest possible exponent to which a number can belong (mod m) is <p(m). If a number belongs to this maximal exponent, we shall call it a primitive root for the modul m. Not every modul has primitive roots, as we have already mentioned; for instance, for the modul m = 15, one finds that every remainder relatively prime to 15 will satisfy the congruence z 4 = 1 (mod 15) and yet ^(15) = 8. The determination of those moduls for which primitive roots can exist is one of the problems to be taken up in the following discussion. From theorem 12-12 we conclude immediately: Theorem 12-13. For a prime modul p there exist <p(p — 1) primitive roots. From the previous table of the exponents to which the various remainders belong (mod 13), we see that 2, 6, 7, 11 are the primitive roots (mod 13). To find the primitive roots of a modul if they exist, one must usually proceed by trial and error, although there are certain rules that may facilitate the search. Often one of the small numbers 2, 3, 5, or 6 may turn out to be a primitive root. The following table gives the smallest positive primitive root for all primes below 200. Extensive tables of primitive roots for primes have been com- EULER'S THEOREM AND ITS CONSEQUENCES 285 puted. The first of these, the Canon ariihmeticus (1839) by K. G. J. Jacobi, included primitive roots for all primes below 1,000. More recent tables by Kraitchik, Cunningham, and others give primitive roots for all primes up to 25,000 and even beyond. Prime Primitive root Prime Primitive root 2 1 89 3 3 2 97 5 5 2 101 2 7 3 103 5 11 2 107 2 13 2 109 6 17 3 113 3 19 2 127 3 23 5 131 2 20 2 137 3 31 3 139 2 37 2 149 2 41 6 151 6 43 3 157 5 47 5 163 2 53 2 167 5 59 2 173 2 61 2 179 2 67 2 181 2 71 7 191. 19 73 5 193 5 79 3 197 2 - 83 2 199 3 12-5. Primitive roots for powers of primes. We shall now tackle the question of finding all moduls for which there exist primitive roots. One of the main results in this direction is Theorem 12-14. There exist primitive roots for all powers of a prime p > 2. 286 NUMBER THEORY AND ITS HISTORY The proof of this theorem is quite long, and we shall take it in several steps. First we show: There exist primitive roots when the modul is a square of a prime. Since <p(P 2 ) = p(p ~ 1) every number a not divisible by p satisfies the congruence a p(p-i) s x (mod p2) We shall take some primitive root r (mod p) and examine when it may be a primitive root (mod p 2 ) . Let r belong to the exponent d (mod p 2 ) so that r d = 1 (mod p 2 ) is the congruence with the smallest possible exponent that r satisfies (modp 2 ). Then d divides p(p — 1). On the other hand, r d = 1 (mod p) and r is a primitive root (mod p) so that d is a multiple of p — 1. The two possibilities for d are, therefore, either d = p — 1 or d = p(p — 1). In the latter case r is a primitive root (mod p 2 ). Thus we are concerned only with the alternative where r^ 1 = 1 (mod p 2 ) (12-22) Clearly, when r satisfies this congruence (12-22) it is not a primitive root (mod p 2 ), but the situation may be remedied by using ri = r + p instead of r. Since r\ = r (mod p) the new number is also a primitive root (mod p). Furthermore, by the binomial expansion we have r/ -. . ^ + t^l^ p+ (p - »& ~ 2 V 3f)2 + ... J- i. ' ^ so that ri* -1 s r*- 1 + p(p - I)!*" 2 (mod p 2 ) EULER'S THEOREM AND ITS CONSEQUENCES 287 From the congruence (12-22) follows further ri P-i _ i == ( p _ l) pr P- 2 (mod p 2 ) This shows that n does not satisfy the condition (12-22), con- sequently it is a primitive root (mod p 2 ). We have established that a primitive root r (mod p 2 ) is a primitive root (mod p) such that the congruence (12-22) does not hold, that is, r p-i = 1 + tp (12-23) where t is not divisible by p. We shall use this to show: A number r with these properties is a primitive root for any power p a . For the proof it is necessary to establish the auxiliary fact that one always has r pa ~ l (p - 1} = 1 + t a • p a (12-24) where the integer t a is not divisible by p. We have assumed this to be true for a = 1, and may therefore use induction to prove it in general. We raise both sides of (12-24) to the pth power and expand the right-hand side by the binomial theorem to obtain r p«(p-l) = ! + V . ta . p a + rtLzJl . ta * . p 2« + . . . 1 1.^5 where the subsequent terms contain p to powers with exponents at least equal to 3a. When we write this expression in the form r P a (p— l) _]__!_ r> a+1 + E_i.C-^ + ■] we shall have to show that the number t a+1 represented by the bracket is not divisible by p. According to the induction as- sumption t a is not divisible by p; the second term is divisible by p (it is integral since p is an odd prime; this is the only place in the proof of theorem 12-14 that this fact is used), and finally all terms in the bracket not written out explicitly are also divisible by p since 3a > a + 1 ; thus t a is not divisible by p as desired. 288 NUMBER THEORY AND ITS HISTORY To prove that r is a primitive root for all powers of p we again proceed by induction and assume that r is a primitive root (mod p a ) and show that it is a primitive root (mod p a+1 ). Let us suppose that r belongs to the exponent d (mod p a+1 ). r d s 1 (mod p a+1 ) We know that d is a divisor of <p(p a+1 ) = p a (p - 1) But since r d = 1 (mod p a ) and r is a primitive root (mod p a ), d is a multiple of p a-1 (p — 1), so that only the two values d = p^Hp - 1) = <p(p a ), d = p a (p - 1) = <p(p a+1 ) are possible for d. But the first of these is excluded by the con- dition (12-24), and r is a primitive root (mod p a+1 ). As an example let us determine a primitive root for the powers of 7. One finds that 3 is a primitive root (mod 7) and since 3 6 - 1 ^ (mod 7 2 ) it is a primitive root (mod 7 2 ) and therefore for all higher powers of 7. The powers of the prime 2 have been excluded from our con- siderations and here the situation is different. For the modul p = 2 there is the primitive root r = 1, and r = 3 (mod 2 2 ) is a primitive root. But for the modul 8 and for higher powers of 2, there are no primitive roots. The numbers relatively prime to the modulus are in this case the odd numbers The square is so that for all of them a = An d= 1 a 2 = 1 ± 8n + 16n 2 a 2 = 1 (mod 8) EULER'S THEOREM AND ITS CONSEQUENCES 289 while <p(S) = 4. Again from a 2 = 1 + St one finds by successive squarings a 4 = 1 (mod 16) a 8 = 1 (mod 32) a 2 " -2 = 1 (mod 2 a ) (12-25) ^(2 a ) = 2 a_1 and in general Since the congruence (12-25) shows that there can be no primitive roots for the higher powers of 2. The congruence (12-25) implies that the highest exponent to which a number can possibly belong (mod 2 a ) is 2 a ~ 2 , when a ^ 3. It is not difficult to find numbers belonging to this maximal ex- ponent, for instance, a = 3 is one of them. This may be seen from the following sequence of congruences, where each is obtained from the preceding by squaring : 3 = -1+4 (mod 8) 3 2 == 1 + 8 (mod 16) 3 4 = 1 + 16 (mod 32) = 1 + 2 a_1 (mod 2 a ) Since <p(2 a ) is a power of 2, every number belongs to an exponent that is also a power of 2. But our last congruence shows that when 3 is raised to the power 2 a_3 one still does not have the remainder 1 (mod 2 a ). The power with the exponent 2 a_2 is therefore the first with this property. It may be noted that 3 is a primitive root (mod 2) and (mod 4) so that it belongs to the 290 NUMBER THEORY AND ITS HISTORY greatest possible exponent for any power of 2. Let us summarize the results: Theorem 12-15. Among the powers of 2 only 2 and 4 have primitive roots. For all higher powers of 2 a , a ^ 3, every odd number satisfies the congruence 2«- = j<p ( 2«) s ! (mod 2 a } a The number 3 is a primitive root (mod 2) and (mod 4) and belongs to the highest possible exponent 2 a ~ 2 when a ^ 3. Problems. 1. Find primitive roots for the powers of all odd primes up to p = 19. 2. Find numbers other than 3 that belong to the exponent 2 a ~ 2 (mod 2 a ). 12-6. Universal exponents. After we have investigated the existence of primitive roots for powers of primes, it is relatively simple to find all numbers divisible by two or more different primes for which there can be primitive roots. Let m = pY . . . (12-26) be some such number. For an arbitrary a relatively prime to m, we know by Euler's theorem that o^ (pa) = 1 (mod p a ) (12-27) for any prime power p a occurring in (12-26). The least common multiple of the various exponents in these congruences (12-27) we shall denote by M = [p*- 1 (p - 1), q*- 1 (q - 1), • • • ] (12-28) Then clearly also a M = 1 (mod p a ) for every prime power p a in (12-26), honce a M = 1 (mod m) (12-29) for every a relatively prime to m. EULER'S THEOREM AND ITS CONSEQUENCES 291 If a primitive root is to exist (mod m), M cannot be less than <p(m). But we know that <p(m) = <p(p a ) v tf) • • • and this product can only be equal to the l.c.m. (12-28) of its factors when these are relatively prime. Ordinarily this is not the case since all numbers <p(p a ) are even, with the single exception 0,(2) = 1. We conclude that only when m has the special form m = 2p a is there a possibility for a primitive root. But in this case such a root is easily obtained. We notice <p(m) = <p(2) • <p(p a ) =<p(p a ) so that when r is a primitive root (mod p a ), we have ,#(«) = i ( mo d p «) (12-30) and <p(m) is the smallest exponent with this property. When r is odd, the congruence (12-30) holds also (mod 2), and therefore (mod m) ; consequently r is a primitive root (mod m). If r should happen to be even, it may be replaced by r x = r + p a which is an odd primitive root (mod p a ). To recapitulate our various results on primitive roots we state: Theorem 12-16. There exist primitive roots only for the three following classes of moduls: 1. m = p a is the power of an odd prime. 2. m = 2p a is the doubh of the power of an odd prime. 3. m = 2 and m = 4. The same class of numbers as those that have primitive roots we have encountered earlier in connection with Gauss's extension 292 NUMBER THEORY AND ITS HISTORY of Wilson's theorem. On the basis of theorem 12-16 we can re- formulate Gauss's theorem as follows: Theorem 12-17. The product P of all positive remainders less than and relatively prime to a number m satisfies the congruence P = ± 1 (mod m) where the sign —1 occurs if and only if there exists a primitive root (mod m). According to a remark which we made in connection with theorem 11-6, we conclude also that a primitive root (mod m) can exist only if the congruence x 2 = 1 (mod m) has no other roots than x = ±1 (mod m) We shall mention another problem closely related to those we have discussed. We know that for a given modul m there exist exponents M such that a M = 1 (mod w) for every a relatively prime to m; for instance <p(m) is such an exponent according to Euler's congruence. We may call such a number M a universal exponent (mod m), and among these there is a minimal universal exponent X(m). This number X(m) is of importance in several questions in number theory, and we shall now show how it may be determined. For a power p a of an odd prime, one must have Hp a ) = <p(p a ) because there exist primitive roots belonging to the exponent <p(p a )- For the powers of 2 the expression for the minimal universal exponent is slightly more complicated. Since there are primitive roots (mod 2) and (mod 4), one has X(2) = 1, X(4) = 2 EULER'S THEOREM AND ITS CONSEQUENCES 293 For the higher powers theorem 12-15 shows that X (2«) = 2 a ~ 2 = %<p(2 a ), oc ^ 3 If one prefers to include the three cases in a single statement, one can write [{$ = a, when a ^ 3 X(2 a ) = 2 /3_2 -j/3 = 3, when a = 2 (12-31) [p = 2, when a = 1 We now turn to the general case and prove: Theorem 12-18. Let m be an integer with the factorization m = 2 ao • p x ai • p 2 a2 • • • (12-32) into prime powers. The minimal universal exponent of m is the least common multiple N = [X(2-), <p(pi ai ), <p(P2 a2 ), ' • •] (12-33) of the corresponding minimal exponents of the prime powers in (12-32). Furthermore, there exist numbers belonging to this exponent (mod m). Since N, according to its definition, is divisible by the smallest universal exponent for each prime power p a occurring in (12-32), we conclude that one has a N = 1 (mod p a ) for any a not divisible by p, consequently also a N = 1 (mod m) (12-34) for any a relatively prime to m. To complete the proof of theorem 12-18, it is sufficient to show that there exists some number a for which N as defined is the smallest exponent such that the congruence (12-34) holds. This may be achieved by taking a to satisfy the congruences a = 2, (mod2 ao ), a = n (modpi" 1 ), a^r 2 (mod p 2 " 2 ), • • • (12-35) 294 NUMBER THEORY AND ITS HISTORY where r u r 2 , . . . are primitive roots of the prime powers pi ai , P2 12 , •••• According to the Chinese remainder theorem, one can always determine some a fulfilling all conditions (12-35). For the various prime powers occurring in the decomposition (12-32) of ra, the number a must belong respectively to the exponents X(2«°), <p{p^), <p(p 2 °*), ... consequently the smallest exponent to which a belongs (mod m) is their l.c.m. N = X(m). The number X(ra), sometimes called the indicator of m, is a divisor of <p(m), but X(m) may be considerably smaller than <p(m) for composite m. For instance, let us take m = 720 = 2 4 • 3 2 • 5 Here <p(m) = 192 while X(m) = [2 2 , *>(9), *>(5)] = [4, 6, 4] = 12 As a consequence every number not divisible by 2, 3, or 5 satisfies the congruence a 12 = 1 (mod 720) We may notice that X(m) according to its definition is even when m > 2. Problems. 1. Find the indicator X(m) for the following numbers: (a) m = 385 (6) m = 144 (c) m = 5! (d) m = 10! In each case try to find a number belonging to the exponent X(m) (mod to). 2. Find a primitive root for the moduls (a) to = 54 (6) to = 50 (c) to = 68 12-7. Indices. We have solved the problem of finding all moduls for which there exist primitive roots. One of the reasons for placing emphasis on this question is that when such a root exists, one can introduce a curious theory reminiscent of logarithms, which in important cases facilitates the study of congruences. EULER'S THEOREM AND ITS CONSEQUENCES 295 Let r be a primitive root for some modul m. We consider the SeneS 1, r, r 2 , ..., r^" 1 (12-36) of the <p(m) first powers of r. None of these can be congruent (mod m). Let us assume, for instance, that i > j and r l = r } (mod m) Since r is relatively prime to m, we can cancel a power of r and obtain i _ j r J = 1 (mod m) and this contradicts the fact that r as a primitive root belongs to the exponent <p(m) (mod m). The <p(w) numbers (12-36) are all incongruent and relatively prime to m so that in some order they must be congruent to the <p(m) relatively prime remainders (mod m). Therefore, for any number a relatively prime to m, one can find a unique exponent i such that a = r l (mod m) (12-37) where ^ i ^ <p(m) - 1 (12-38) This exponent i we shall call the index of the number a for the root r (mod m) and denote it by i = Ind r (a) (12-39) Very often the root r remains the same throughout some dis- cussion, and it may then be dropped in the notation (12-39). Among the special cases we notice particularly Ind r 1=0, Ind r r = 1 As an example let us take the modul m = 9. Here <p(m) = 6 and r = 2 is a primitive root. We compute the various powers of r and find 1 2 4 = 7 2, 2 5 = 5 (mod 9) 2 2 = 4, 2 6 = 1 2 3 _ 296 NUMBER THEORY AND ITS HISTORY This gives us the following table of the numbers with given indices (mod 9) for the root r = 2: Index 1 2 3 4 5 Number 1 2 4 8 7 5 To obtain the index of a given number one rearranges the table to make the remainders relatively prime to 9 the primary entry. Number 1 2 4 5 7 8 Index 1 2 5 4 3 In a similar example let us take m = 23. A primitive root is r = 5, and through a reduction of the powers of 5 (mod 23), one finds the table: Index 1 2 3 4 5 6 7 8 9 10 Number 1 5 2 10 4 20 8 17 16 11 9 Index 11 12 13 14 15 16 17 18 19 20 21 Number 22 18 21 13 19 3 15 6 7 12 14 Through rearrangement of the entries in this table, one obtains the companion table: Number 1 2 3 4 5 6 7 8 9 10 11 Index 2 16 4 1 18 19 6 10 3 9 Number 12 13 14 15 16 17 18 19 20 21 22 Index 20 14 21 17 8 7 12 15 5 13 11 EULER'S THEOREM AND ITS CONSEQUENCES 297 In the definition (12-37) of the index, we assumed that it was limited to the range given in (12-38). It is practical to drop this convention and permit several indices for the same number. If for two numbers i\ and i 2 , we have simultaneously a == r ix = r h (mod m) (12-40) it follows that r i\-h = i ( mo d. m) Since r belongs to the exponent <p(m) (mod m) this congruence is possible only when i\ — i 2 is a multiple of <p(m), hence tist2 (mod <p (m)) (12-41) Conversely, when the congruence (12-41) is fulfilled it is easily seen that (12-40) must hold. Therefore, in dealing with indices, two indices shall be considered to be the same when they are congruent (mod v(m)) and relations between indices may be treated as congruences (mod <p{m)). The defining congruence (12-37) for the index of a number can be written in the form a = r Indr(a) (mod m) (12-42) This is entirely analogous to the definition of logarithms to some base g by the common rule a = g l0 ^ a and the indices could well have been called congruence logarithms. In regard to congruences, they have applications similar to those of the logarithms for leal numbers. The idea of indices goes back to Euler, but Gauss gives the first systematic discussion in the third section of the Disquisitiones. The basic law for logarithms is expressed in the formula for the logarithm of a product log (rib) = log a + log b For indices one has analogously Ind (rib) = Ind a + Ind b (mod <p(m)) (12-43) 298 NUMBER THEORY AND ITS HISTORY The proof is immediate : From a = r Inda^ h _ ^nd 6 ( mod m ) one obtains by multiplication a-b = r Ind (a ' 6) = r Lnda + lndb (mod m) from which the rule (12-43) follows. Examples. Let us take w = 23, <p{m) = 22, a = 15, 6 = II so that ah = 165 s 4 (mod 23) Here one finds from our previous table Ind a = 17, Ind b = 9, Ind (ab) = 4 and this agrees with the rule (12-49) since 17 + 9 s 4 (mod 22) The formula (12-43) can be extended to an arbitrary number of factors. When applied to n equal factors a, one has the power rule Ind a n = n Ind a (mod <p(m)) (12-44) Among the applications of the index theory, let us consider first the solution of a linear congruence ax = b (mod ra) where a and b are relatively prime to the modul m. By taking- indices, one finds according to (12-43) Ind a -\- Ind x = Ind b (mod <p(m)) or Ind x = Ind 6 — Ind a (mod <p{m)) Examples. 1. Let us solve the congruence 7x = 2 (mod 9) EULER'S THEOREM AND ITS CONSEQUENCES 299 By means of the table of indices (mod 9), one concludes Ind x = Ind 2 - Ind 7 s 1 - 4 s 3 (mod 6) and the number corresponding to this index is x = 8 (mod 9) 2. Next we solve the congruence 17s ss 9 (mod 23) by means of the table of indices (mod 23). One finds Ind x s Ind 9 - Ind 17 = 10 - 7 = 3 (mod 22) and the number with this index is x = 10 (mod 23) It is seen from the examples that in the index calculus it is convenient to have a double set of tables, one with the number as entry giving the indices, and another with the indices as entries giving the corresponding numbers. In this respect the indices are not as easy to handle as the logarithms, since the values of the logarithms occur in order and one can use the same table to find both the logarithms and the antilogarithms. Congruences of the type ax n = b (mod m) (12-45) may be solved readily by means of indices. By the previous rules (12-43) and (12-44), one finds Ind a + n Ind x = Ind b (mod <p(m)) so that Ind x is the solution of the linear congruence n Ind x = Ind b — Ind a (mod <p(rn)) (12-46) Similarly, for an exponential congruence ab x = c (mod m) (12-47) one finds the solution from x Ind 6 = Ind c - Ind a (mod p(m)) (12-48) It should be noted that the congruences (12-45) and (12-47) may have one or several or even no solutions, depending on the be- 300 NUMBER THEORY AND ITS HISTORY havior of the resulting linear congruences (12-46) and (12-48) for the indices. Examples. 1. Let us take 3x 5 = 11 (mod 23) Here one finds 5 Ind x = Ind 11 - Ind 3 (mod 22) or 5 Ind x = -7 (mod 22) This congruence has a single solution Ind x = 3 (mod 22) and from the table one finds x = 10 (mod 23) 2. We wish to find integers x such that 3x u = 2 (mod 23) This leads to 14 Ind x = Ind 2 - Ind 3 = -14 (mod 22) and one finds two solutions Ind x s 10, Ind x = 21 (mod 22) which correspond to the values x = 9, x = 14 (mod 23) 3. There is no solution to the congruence 13* = 5 (mod 23) because it leads to x Ind 13 = Ind 5 (mod 22) or 14x = 1 (mod 22) which is impossible. Let us mention finally that the indices may be used to determine the exponent to which a number a belongs (mod m). This exponent x is the smallest positive solution of a x = 1 (mod m) EULER'S THEOREM AND ITS CONSEQUENCES 301 Consequently x Ind a = (mod <p(m)) and if <p{m) and Ind a have the greatest common factor d, one must have <p(m) x = d For instance, the number 3 has the index 16 and since (16, 22) = 2 it belongs to the exponent 11 (mod 23). The index theory is valid only for moduls with primitive roots. This difficulty may be evaded by various methods, by generali- zation of the theory or by relying on the fact that a congruence can be reduced to prime-power moduls p a and that for such moduls there exist primitive roots when p > 2. A more serious defect, in comparison with logarithms, is that the tables of indices must be computed separately for each modul. Gauss, in a supplement to the Disquisitiones, gives a table of indices for the possible moduls up to 100. A monumental achievement is the Canon ariihmeticus of K. G. J. Jacobi, which contains dual sets of index tables for all prime powers up to 1,000. By means of these tables, a large number of congruence problems for moderate-sized moduls may be solved with great ease. Problems. 1. Solve the following problems by means of indices: (a) 7x = 13 (mod 23) (b) 4x = 19 (mod 23) (c) Sx 7 = 11 (mod 23) (d) llx 3 s 2 (mod 23) (e) 5 • 7 X = 2 (mod 23) (/) 7 • ll 1 = 15 (mod 23) (g) To which exponents do 11, 13, and 15 belong (mod 23)? 302 NUMBER THEORY AND ITS HISTORY 2. Construct a table of indices (mod 19) and use it to solve the following problems: (a) 3x s 17 (mod 19) (6) 3x 4 = 4 (mod 19) (c) 13x 7 = 2 (mod 19) (d) 3 • 5 X = 1 (mod 19) (e) To which exponents do the numbers 2, 3, 4, and 5 belong (mod 19)? 12-8. Number theory and the splicing of telephone cables. We have established previously that for each modul m there exist numbers r that belong to the greatest possible exponent X(m), the universal exponent or indicator (mod m). This may be stated in the form that there exist numbers r relatively prime to m such that the remainders (mod w) of the powers r, r 2 , r 3 , ... (12-49) avoid the value + 1 as long as possible. We shall now discuss a problem of a very similar character. This time we shall try to determine a number r such that the remainders (mod m) of the series (12-49) avoid both values ±1 as long as possible. For some number r, relatively prime to m, let us say that t is its ±l-expownt when it is the smallest possible exponent for which either one of the congruences r' s ±1 (modm) (12-50) is fulfilled. Our problem is then to determine the largest possible ±l-exponent X (m) that may occur (mod w). We notice that the ± 1-exponent of a number can at most be equal to the exponent to which the number belongs (mod m). The general result is: Theorem 12-19. The maximal ± 1-exponent X (m) for a number m > 2 has the value Xo(m) = ^X(m) (12-51) when there is a primitive root (mod m), and otherwise Xo(m) = X(m) (12-52) EULER'S THEOREM AND ITS CONSEQUENCES 303 Let us suppose first that there exists a primitive root (mod m). We noticed in Sec. 12-6 that a primitive root can only exist when the congruence x 2 £= 1 (mod m) has no other roots than x = ±1 (mod m) For a modul with a primitive root one has X(ra) = <p{m) and we recall that <p(m) is even when m > 2. From Euler's theorem follows r <p(m) = ( r -^(m))2 s x (mcd m ) for any r relatively prime to m, consequently r Wjn) = ±1 ( mod TO ) The maximal ±1 exponent X (m) can therefore at most be equal to \(p(m). On the other hand it cannot be less than this number, because if t ia the ±1 exponent of a primitive root r, it follows from (12-50) that r 2t = 1 (mod m) (12-53) hence 2t is divisible by <p(m) and t is divisible by %<p(m). Thus when there exists a primitive root, the maximal ±1 exponent Xo(m) is determined by (12-51). To complete the proof of theorem 12-19 we must deduce that ^o( m ) = M m ) when there is no primitive root. Let us take some number r belonging to the exponent X(m). If the ±l-exponent of r should be t < X(m), the congruence (12-53) would hold and 2t would be divisible by X(w). This is only possible when t = ^X(m) and then one must have mm) = _ 1 ( mod m ) (12-54) Therefore, if we can find a number r belonging to the exponent X(ra) such that the congruence (12-54) does not hold, we will have proved the equality (12-52). 304 NUMBER THEORY AND ITS HISTORY The reasoning must again, as in so many number-theory inves- tigations of this kind, be separated into several cases. The prime factorization of to may be to = 2>i> 2 a2 • • • (12-55) and we suppose first that there are at least two odd primes pi and p 2 . Among the ^-functions of the various odd prime powers in to, let <p(pi ai ) be one that is divisible by the smallest power of 2 and let us select a number Pl that belongs to the exponent |<?(Pi ai ) (mod pi ai )- The square p x = n 2 of a primitive root r x can be used. A number r can be defined by the Chinese remainder theorem by the following set of congruences r = 3 (mod 2 ao ), r = pi (mod pf 1 ), r = r 2 (mod p 2 a2 ), • • • where the subsequent numbers r 2 , r 3 , . . . are primitive roots for the corresponding prime powers. The exponent to which r belongs (mod m) is equal to the least common multiple rx(2-), h(Vi ai ), *(P2 a2 ), <p(P3 a3 ), ...] The manner in which pi was chosen insures that this number is equal to A (to). But by the definition of r one has also r i*(Pi«i) = pi i<p(pi ai ) = i (mod pf 1 ) and since i<p(pi ai ) divides J\(m) this implies /\(m) = 1 (mod pi ai ) which is incompatible with the congruence (12-54). In the next cases, the number w has the form to = 2 ao • pi ai (12-56) with «i ^ 1 and here a ^ 2 since there shall be no primitive root. For the special cases to = 4 • p! 011 , to = 8 • pi" 1 one obtains X(m) = [2, *(?!«)! = <P(Vi ai ) EULER'S THEOREM AND ITS CONSEQUENCES 305 This shows that the number r defined by the congruences r = 1 (mod 4), r = ri (mod pi ai ) where r x is a primitive root (mod pi ai ), must belong to the ex- ponent X(m) (mod m). Furthermore, the congruence (12-54) cannot hold since r i\(m) = X (mod 4) Fig. 12-1. Cross section of one layer of cable. When we suppose that a Q ^ 4 in (12-56), we define our r by the congruences r = 3 (mod 2 a °), r = r x (mod p^ 1 ) and as in Sec. 12-5, it follows that r belongs to the exponent X(m) (mod m). In this case the number A(2 a °), and therefore X(m), is divisible at least by the second power of 2; from 3 2 = 1 (mod 8) one concludes that r lUm) s 3 ^X(m) _ x ( mod g) which again shows that the congruence (12-54) is not fulfilled. The same argument with r = 3 is applicable in the final case where m is a power of 2. H. P. Lawther, Jr., in an article in the American Mathematical Monthly, has pointed out how such a theory may be applied to introduce a systematic method for splicing telephone cables. The 306 NUMBER THEORY AND ITS HISTORY cables for long-distance telephone service are manufactured in concentric layers of insulated wires or conductors. The cable is produced in sections of approximately uniform length, each perhaps 1,000 feet long, and the line is made up of a succession of such sections spliced end to end. At the splices the order of the wires should be mixed up considerably to minimize interference and cross talk, and it is particularly desirable to avoid having two s Fig. 12-2. Splicing arrangement. conductors that are adjacent in one section adjacent in sections following closely afterward. For practical purposes the splicing scheme cannot be compli- cated, and it would seem that the following three rules would embody the utmost in simplicity: 1. The same splicing directions should be used at each inter- section. 2. The wires in one concentric layer are spliced to those in the corresponding layer in the next section. 3. When some wire in one section &\ is spliced to a wire in the next section S 2 , the adjacent wire in Si should be spliced to the wire in S 2 that is obtained from the one last spliced by counting forward a fixed number s. (See Fig. 12-2 for the case s = 2.) The number s may be called the spread of the splicing rule. For instance, if one takes a layer in a cable in which there are 11 wires, the following table gives the splicings for the spreads s = 2 and s = 3. EULER'S THEOREM AND ITS CONSEQUENCES 307 8 = 2 s =3 1-*1 1-»1 2^3 2-+4 3->5 3->7 4->7 4->10 5-»9 5-+2 6 -+11 6->5 7->2 7->8 8-+4 8 -+11 9-+6 9-*3 10^8 10->6 11 ->10 ll->9 The numbers in each of the right-hand columns are obtained from the first 1 by adding 2 or 3 each time. Since the arrangement of the wires is circular, the numbers are reduced (mod 11). One sees that the first wire in Si always corresponds to the first wire in S 2 ; this is only an expression for an agreement to let the count in the second section start from the first wire spliced. In general the splicing table for a spread s will run 1-*1 2->l + s 3 -+ 1 + 2s (mod m) (12-57) 1 + (i - 1)8 where the numbers on the right shall be reduced to their smallest positive remainders (mod m), when m is the number of wires in a cylindrical layer. It should be observed that the correspondences (12-57) impose a condition limiting the number of acceptable spreads s. As a consequence of the rather trivial fact that two wires in Si always are spliced to two distinct wires in >S 2 , one concludes that all 308 NUMBER THEORY AND ITS HISTORY remainders of the numbers on the right in (12-57) must be different. In other words, a congruence 1 -f- is == 1 + js (mod m) or (i - j) s = (mod m) (12-58) will not be possible except when i = j. This is the case only when the spread s is relatively prime to m; because if s had a common factor d with m, the congruence (12-58) would be fulfilled when- ever i andj differed by m/d or a multiple of this number. Now let us repeat the splicing process. By the first operation the ith. wire in Si was connected with the wire number *2 = 1 + (*' _ 1 ) s in S 2 . By the second splice this wire leads to wire number h = 1+ {h ~ l)s = 1 + (i - 1> 2 and when this is continued the ith wire in the first section, after n splices, will be connected with the wire numbered i n+1 = 1 + (i - l)s n (mod m) (12-59) in the (n + 1) section. The object of our splicing arrangement was to produce a scatter in the distribution of the connections such that two wires that were adjacent in some section would stay separated as long as possible in the subsequent sections. Let us examine how our scheme behaves in this respect. Two adjacent wires in some section may be numbered i and i + 1. According to (12-59), after n splices, they become connected with the wires numbered respectively 1 + (i - l)s n , 1 + is n (mod m) These two wires are adjacent only if their difference is congruent to ±1 (mod m), that is, when 1 + is n - (1 + (i - IK) = ±1 (mod m) or s n = ±1 (mod m) EULER'S THEOREM AND ITS CONSEQUENCES 309 This basic condition leads us directly back to our previous number-theory investigations. It shows that in order to keep onetime adjacent wires separated as far as possible, one must select the spread s as a number whose ±l-exponent (mod m) has the maximal value X (m). In the preceding we have made all necessary preparations for this problem. We know how such a spread s may be determined and also how to compute the value of the corresponding maximal ±l-exponent X (m). In the paper by Lawther, one finds a table giving the value of X (ra) for all ra's up to m = 139, as well as a suitable spread s. For the first small values the table is as follows: TO Xo s m Xo s 5 2 2 13 6 2 6 1 5 14 3 3 7 3 3 15 4 2 8 2 3 16 4 3 9 3 2 17 8 3 10 2 3 18 3 5 11 5 2 19 9 2 12 2 5 20 4 3 The reader may check some of these results and compute the values of X for some of the higher moduls m. Let us make the final observation that when the modul is a prime p, theorem 12-19 shows that , v- 1 is the number of sections for which no two wires are adjacent more than once. In comparison with the number m of wires, this is the best possible result obtainable by any method. To see this, one need only notice that when one starts with some wire it can only remain separated from adjacent ones as long as it is possible to find a new pair of wires between which it can be placed at each splice, and altogether there are only \ (m - 1) such different pairs. 310 NUMBER THEORY AND ITS HISTORY Let us only mention, finally, that there are other ways in which this problem may be handled. Bibliography Cunningham, A. J. C, H. J. Wood all, and T. G. Creak: Haupt-exponenls, Residue-indices, Primitive Roots and Standard Congruences, London, 1922. Jacobi, K. G. J. : Canon arithmeticus, sine tabulae quibus exhibentur pro singulis numeris primis vel primorum potestatibus infra 1000 numeri ad datos indices et indices ad daios numeros pertinentes, Berlin, 1839. Kraitchik, M. : Recherches sur la theorie des nombres, Paris, 1924. Lawther, Jr., H. P.: "An Application of Number Theory to the Splicing of Telephone Cables," American Mathematical Monthly, Vol. 42, 81-91 (1935). CHAPTER 13 THEORY OF DECIMAL EXPANSIONS 13-1. Decimal fractions. In the opening chapter we discussed the number systems and number representations. When the basic group was b, we could write every integer uniquely by means of the powers of & in the form N = (c n , Cn_]_, • • • , ci, c )b = c n -b n + c n _i • b n ~ l + • • • + a • b + c where the c/s can take values from to b — 1. From a mathe- matical point of view, it may appear simple to extend this process and use negative powers of b to represent the fractions, as we do with our decimal fractions. Historically, however, this does not seem to have been an easy step. In dealing with the fractions those that are encountered first and the ones that are used most commonly are the very simplest 112 13 2) 3> 3> 4=> 4> • • • and it may not appear natural even now to put them in the strait jacket of decimal notation. Furthermore, such representation may even involve conceptual difficulties; for instance, ^ is a much more easily understood and explicable concept than the infinite series 10 " 10* ' 10" 0.333 •••=— + -2 + ^3 + These remarks may explain, at least in part, why the decimal fractions made their appearance relatively late in the history of the number concept and why a similar construction was not achieved in other number systems. As an exception, one should 311 312 NUMBER THEORY AND ITS HISTORY mention the Babylonian sexagesimal system. As we have already stated, it was based on a positional principle but without an absolute determination of values. Thus the symbol ff may mean 2 or 2 X 60 or 2 X 60 2 and so on, but it can also signify 1 1 2 X — » 2 X — , » • • • 60 60 2 Although there was no indication of the integral part of a number or even the power a certain symbol may denote, the system included almost all the practical advantages of the decimal notation. For instance, the common tables of inverses could be considered to give the expansions according to the negative powers of 60. The Babylonian preeminence in extensive and accurate computations must have been induced by this technical perfection of their number system. Probably this is one of the contributory reasons for the persistent use of sexagesimal notations in many later Greek and Arab mathematical texts, particularly in the field of astronomy. We may recall that even Leonardo Pisano, the ardent protagonist of the Hindu positional numbers, when con- fronted with the necessity of computing a root of a cubic equation with great accuracy in one of his tournament problems, resorts to sexagesimal computations and gives the answer in this nota- tion as x= l°22 I 7 II 43 m 33 IV 4 v 40 VI There are initial steps towards decimal notation and computa- tions to be found among Arabic and European mathematicians by the fifteenth century. These attempts usually appeared through a desire to eliminate fractional computations by the simplest possible operation, namely, the multiplication of the numbers by powers of 10. For instance, to compute V2 one would prefer to take the square root of the number 1,000^2 = ^2,000,000 and proceed to calculate with integers. THEORY OF DECIMAL EXPANSIONS 313 The first work in which one finds computations with decimal fractions is a collection of reckoning examples by Christoff Rudolff , which appeared in Augsburg in 1530. He uses a decimal notation similar to the modern one, with a bar to separate the integral and fractional parts. In spite of the fact that Rudolff's books, The Rules of Coss and Reckoning Manual, enjoyed great contemporary popularity, little is known about his life except that he spent most of his time in Vienna as an "amateur of the liberal arts," as he characterizes himself in the foreword to one of his books. The first systematic presentation of the rules of operations on decimal fractions was given in 1585 in a brief treatise in Dutch, De Thiende, written by Simon Stevin. A French translation under the title La Disme followed shortly afterward. Simon Stevin (1548-1620) was a curious, many-sided genius who com- bined his strong scholarly leanings with great ability for practical constructive and organizational tasks. He made inventions of various kinds, became quartermaster general of the Dutch army during the critical period of the Spanish wars, and also was put in charge of the system of dikes and waterworks. He reorganized the system of governmental bookkeeping, computed interest tables, and proposed reforms in weights and measures suggestive of the metric system. His writings on the art of fortifications are well known, but at the same time he translated Diophantos into French and published books on arithmetic, geometry, mechanics, and hydrostatics. He seems to have been the first to formulate explicitly the law of the triangle or parallelogram of forces in mechanics. La Disme has the subtitle "Teaching how all computations that are met in business may be performed by integers alone without the aid of fractions." The pamphlet opens as follows: To astrologers, surveyors, measurers of tapestry, gaugers, stereometers in general, mintmasters and to all merchants Simon Stevin sends greeting: A person who contrasts the small size of this book with your greatness, my most honorable sirs to whom it is dedicated, will think my idea absurd, especially if he imagines that the size of this volume bears the same ratio to human ignorance that its usefulness has to men of your outstanding 314 NUMBER THEORY AND ITS HISTORY ability; but in so doing he will have compared the extreme terms of the proportion which may not be done. Let him rather compare the third term with the fourth. What is it that is here propounded? Some wonderful invention? Hardly that, but a thing so simple that it scarce deserves the name in- vention; for it is as if some stupid country lout chanced upon great treasure without using any skill in the finding. If any one thinks that, in expounding the usefulness of decimal numbers, I am boasting of my cleverness in devising them, he shows without doubt that he has neither the judgment nor the intelligence to distinguish simple things from difficult, or else that he is jealous of a thing that is for the common good. However this may be, I shall not fail to mention the usefulness of these numbers, even in the face of this man's empty calumny. But, just as the mariner who has found by chance an unknown isle, may declare all its riches to the king, as, for instance, its having beautiful fruits, pleasant plains, precious minerals, etc., without its being imputed to him as conceit; so may I speak freely of the great usefulness of this invention, a usefulness greater than I think any of you anticipates, without constantly priding myself on my achievements. 1 The introduction of the decimals was an innovation for which the time was ripe, and after the publication of La Disme one sees a rapid increase in their use. In numerical tables the advantages of decimals over ordinary fractions are particularly evident. Shortly before the appearance of La Disme, Stevin had computed and published a set of interest tables, and one may well conjecture that this had led him to an appreciation of the simplicity of decimal procedures. The invention of logarithms and the introduction of logarithmic tables shortly afterwards undoubtedly contributed greatly to the progress of decimals. Stevin presaged another practical innovation in a statement toward the end of the pamphlet In view of the great usefulness of the decimal division, it would be a praiseworthy thing if the people would urge having this put into effect so that in addition to the common divisions of the measures, weights and money, that now exist, the state would declare the decimal division of the 1 Translation by V. Sanford, in D. E. Smith, A Source Book in Mathe- matics. THEORY OF DECIMAL EXPANSIONS 315 large units legitimate to the end that he who wished might use them. It would further this cause also, if all new money should be based on this system of primes, seconds, thirds, etc. [tenths, hundreds, thousands]. If this is not put into operation as soon as we might wish, we have the con- solation that it will be of use to posterity, for it is certain that if men of the future are like men of the past, they will not always be neglectful of a thing of such great value. Not all of Stevin's reform proposals had the same ultimate success. In one of his works on geography he makes strong propaganda for Dutch as a world language, and he demonstrates its supremacy over other languages in the briefness of expression and in its superabundance of words of one syllable. 13-2. The properties cf decimal fractions. In computing with decimals it soon became apparent that the numbers fall into several distinct categories with respect to their expansions. For some the expansion might break off after a finite number of terms; for others it might be infinite. In the latter case the digits could progress without any discernible law, or from a certain point on they might repeat themselves periodically, forming circulating decimals. Certain rules for the expansion of rational numbers into decimals had already been propounded by earlier mathe- maticians, but not until Gauss were those indispensable tools of number theory created that were required for a systematic explor- ation. In the sixth and next to last section of the Disquisitiones, Gauss considers the use of his results in certain applications, among them the properties of decimal expansions of fractions. The characterization of the numbers with a finite decimal expansion is quite simple; the main idea has in reality been pre- sented already in our discussion of the Babylonian mathematical tablets. As a general remark for the subsequent considerations, let us observe that when dealing with the properties of decimal expansions, we shall usually disregard the integral part of a number since it has no influence on the decimals. When some number has a finite expansion ai a 2 a n r = 0, a u a 2 , • • • , a n = — -f- j^ i r 1Qn 316 NUMBER THEORY AND ITS HISTORY it may be written a! • 10 71 - 1 + « 2 • 10 n ~ 2 + • ■ • +a n p r = <2 Therefore r is a rational nurriber whose denominator q in the reduced form contains only prime factors of 10, that is, 2 and 5. For instance, 0.1375 = i™ = 11 - " 10,000 80 2 4 • 5 Conversely let us take a fraction P r = 2 a -5 /3 If, for example, a ^ /?, we may multiply both numerator and denominator by 5 a_ ^ so that 5 a -Pp r = 10 a and this shows that r can be written with a finite decimal expansion. Theorem 13-1. The numbers with a finite decimal expansion are the fractions r = ^r^ ( 13 -!) It is not difficult to see that when r is in reduced form (13-1), the number of decimals in the expansion is the larger of the two exponents a and (3. In general, let us say that a number is regular with respect to some base number b when it can be expanded in the corresponding number system with a finite number of negative powers of b. Through exactly the same argument as before, one concludes that the regular numbers are the fractions V r = - THEORY OF DECIMAL EXPANSIONS 317 where q contains no other prime factors than those that divide b. Then there exists some exponent n such that q divides b n , and when r is reduced and n is the smallest exponent that can be used for this purpose, the number of "decimal" terms is exactly n. Since we are mainly interested in the number-theory properties that regulate the expansions into decimal fractions, we shall sup- pose that the reader is familiar with the essential principles of decimals. In particular, we know that every real number can be expressed by a decimal fraction, and this expansion can be per- formed in only one way. The single exception to this last state- ment occurs for numbers with a finite expansion. Here one can diminish the last digit by one unit and continue with an infinite series of nines, as for instance, in the examples 1.00 ••• = 0.999 • • • , 0.375 = 0.374999 • • • Since we have already completed the discussion of numbers with finite expansions this anomaly need not concern us here. We shall examine the decimal expansions one obtains for tie various reduced fractions r = -, (m,n) = 1 (13-2) n where the denominator n is some fixed integer. Gauss calls the decimal sequence of a number, disregarding the integral part, the mantissa of the number. This is a term that was first introduced by Briggs in connection with his logarithms to the base 10, and he uses it in the sense of a "minor part" or "appendix." As we have already stated, the mantissa of a number is the main object of our subsequent studies. Two fractions m/n and l/n in (13-2) have the same mantissa when their difference m I _ , n n is an integer, in other words when m = I (mod n) 318 NUMBER THEORY AND ITS HISTORY Therefore, to obtain the various mantissas for the fractions (13-2), we can limit ourselves to those fractions in which the numerator m is one of the <p(n) remainders less than and relatively- prime to n. For instance, for the denominator n = 18, the fractions 1 5 _7_ li II 1.1. T8> T8' 18' 18' 18' 18 will exhaust all possibilities for the mantissas. Another simple but essential remark is the following: When the mantissa of the fraction m/n is known, one finds the mantissa of the fraction 10 • m/n by dropping the first digit on the left. For instance i = 0.142857 • • • has the mantissa 142857 . . . , while the mantissa of hf- is 428571 .... On the basis of these observations, it is not difficult to prove that the decimal expansion of a rational number m/n is always periodic, i.e., that the mantissa after a certain number of terms consists of groups of digits that keep repeating themselves indefi- nitely. For instance, 5 7 = 0.3454545 • • • loo We consider the series of fractions m 10m 10 2 m , . — } ) > . . . \16-o) n n n Here the mantissa of the first fraction will produce those of all the subsequent ones by leaving out successively one, two, and so on, digits from the left. But in the unlimited sequence of numer- ators of the fractions (13-3) m, 10m, 10 2 w, . . . the numbers cannot all be incongruent (mod n). Consequently, there exists some first exponent s such that m ■ 10 s = m • 10 s+t (mod n) (13-4) THEORY OF DECIMAL EXPANSIONS 319 and the two fractions m- 10 s m • 10 8_H have the same mantissa. This means that leaving out s digits and s + t digits from the mantissa of m/n will produce the same sequence. We conclude, therefore, that in the decimal expansion of m/n the digits will repeat themselves periodically after s terms, in groups of length t. Since in (13-2) we made the assumption that m and n were relatively prime, the factor m in (13-4) can be canceled to give the equivalent congruence 10 s = 10 s+< (mod n) Conversely, let us take some periodic decimal fraction r = 0.aia 2 • • • a s b x b 2 • • • b t b x b 2 • • • b t • • • (13-5) where the period has the length t and begins after the s first terms. When (13-5) is multiplied by 10 s and 10 s+< one obtains 10 S+ V = a x a 2 ■ - • a s bib 2 • ■ • b t .hb 2 ■ • • b t • • • 10V = aia 2 • • • a s .b\b 2 • • • b t • • • The two numbers on the right have the same mantissa so that their difference A is an integer. By subtracting one from the other, we find (10 S "M _ 10 «) r = A and we conclude that A m r = l s+t _ 10 s n is rational. Furthermore, it is clear that 10 s and 10 s+ * are the smallest powers of 10 such that r • 10 s and r • 10 s+ ' have the same mantissa. We conclude therefore: Theorem 13-2. Any periodic decimal fraction represents a rational number, and conversely any rational number has a 320 NUMBER THEORY AND ITS HISTORY periodic decimal expansion. When a rational number m ( \ i — > (w, n) = 1 n is expanded, the period begins after s terms and has a length t, where s and t are the smallest numbers such that 10 s = W +t (mod n) (13-6) This condition shows the further interesting fact that the length of the period as well as the point at which it starts depends only on the denominator n and not on the numerator m. Examples. 1. Let us consider the expansions with denominator 18. For the powers of 10 (mod 18), one finds simply 1, 10, 10 2 = 10 so that s = 1 and t = 1. This is confirmed by the decimal fractions J^ = .055 • ■ ■ , H = - 611 • • • A-.277--., H--722-.- ^ = .388.-., i| = .944... 2. In a second illustration we take the fractions with denominator 84. The remainders of the powers of 10 (mod 84) are found to be 1, 10, 16, -8, 4, 40, -20, -32, 16 The period therefore begins after two terms and has the length 6; for instance, |f = .44 047619 047619 When the denominator n of the fraction to be expanded has no factors 2 or 5, the conditions become simpler. Since n is relatively prime to 10, we can cancel in the congruence (13-6) to obtain 10* = 1 (mod n) (13-7) This shows that we have s = and the period starts with the first decimal, or as one sometimes says, the expansion is purely periodic. The length of the period is the exponent to which 10 belongs THEORY OF DECIMAL EXPANSIONS 321 (mod n). Conversely, it is clear that a congruence (13-7) can hold only when n and 10 are relatively prime so that we may say: Theorem 13-3. The decimal expansion of an irreducible fraction m/n is purely periodic if and only if n has no prime factors 2 and 5, and in this case the length of the period is equal to the divisor t of <p(n) to which 10 belongs (mod n). Example. Let us take n = 7. The remainders of the successive powers of 10 (mod 7) are 1, 3, 2, 6, 4, 5, 1 This shows that 10 belongs to the exponent 6 (mod 7), or, in other words, 10 is a primitive root (mod 7). All fractions with denominator 7 have periods of length 6; for instance, f = .285711 - • • We return for a moment to the general case where the denom- inator n in the fraction may have factors 2 and 5, and write n = n {) -2 a -5 , (n , 10) - 1 The preceding result may be used to reformulate the criteria in theorem 13-2. When one multiplies the fraction m/n by 10 M , where m is the larger of the exponents a and /3, the resulting fraction 2 n.-a . 5 m-0 . m 10" - = n no has a denominator relatively prime to 10 and n is the lowest exponent by means of which this can be achieved. Theorem 13-3 gives us then: Theorem 13-4. When the denominator of a fraction m/n has the form n = wo • 2 a • 5", (n , 10) = 1 the period in the decimal expansion of m/n begins after n terms, where ju is the larger of a and 0, and the length of the period is the exponent to which 10 belongs (mod no). 322 NUMBER THEORY AND ITS HISTORY Examples. Let us reconsider our previous examples from this new point of view. When n = 18 = 2 • 9,_the period must begin after the first term and have the length 1 since 10 = 1 (mod 9) When n = 84 = 2 2 • 21, the period starts after the second decimal and has the length 6 since one finds that 10 belongs to the exponent 6 (mod 21). We have mentioned that in the expansion of an irreducible fraction m/n in decimals all periods begin at the same point and have the same length for a given n. Let us discuss briefly the interrelation between the various periods defined by n. We may multiply m/n by a suitable power of 10 so that the expansion becomes purely periodic, or, equivalently, n shall be assumed relatively prime to 10. The general situation can best be explained on the basis of some examples. Examples. 1. We first take the decimal expansions of fractions with denominator 7. Since 10 belongs to the exponent 6 (mod 7), the period is 6 and \ = .142857 • • • This fraction is multiplied by the successive powers of 10 and the integral parts discarded. There results a set of decimal fractions whose mantissas are derived from that of \ by leaving out one, two, and so on, digits on the left. Since the powers of 10 (mod 7) have the remainders 1, 3, 2, 6, 4, 5, 1 that j- = .142857 • • • f = .857142 f = .428571 • • • -f- = .571428 f- = .285714 • • • , f = .714285 All possible mantissas for the denominator 7 can therefore be obtained from one of them by permuting the digits in the period cyclically. It is evident that the same situation will prevail whenever 10 is a primitive root (mod n). An index table in which the numbers are arranged according to their indices will give the information as to which period appears for a prescribed fraction. THEORY OF DECIMAL EXPANSIONS 323 2. Next let us take an example where 10 is not a primitive root (mod n), for instance, n = 13. In this case the remainders of the powers of 10 (mod 13) are 1, 10, 9, 12, 3, 4, 1 and from the expansion of T V one consequently finds T V = .076923 • • • , f f = .923076 if = .769230 • • • , T 3 3 = .230769 T 9 3 = .692307 • • • T 4 3 = .307692 Here we have only half of the twelve reduced proper fractions with denominator 13. The numerator 2 is not among them so that we multiply 2 by the powers of 10 (mod 13). The remainders are 2, 7, 5, 11, 6, 8, 2 and, correspondingly, one has the cyclic family of expansions T 2 3 = .153846 • • • , H = .846153 • • • ^ = .538461 • • • , T 6 3 = .461538 • • • 5 _ T3" - .384615 ■ • • , T 8 3 = -615384 In the general case the situation is analogous. When the number 10 belongs to the exponent t, the <p(n) mantissas of the fractions with the denominator n will fall into cp (n)/t families, the periods are of length t and within each family the mantissas are obtained by cyclical permutations as above. For instance, 10 be- longs to the exponent 5 (mod 41) ; hence, the period of the fractions with denominator 41 is equal to 5 and the mantissas fall into 8 cyclical classes. There exist tables that give the classes of mantissas for all numbers not divisible by 2 or 5 up to certain limits. Gauss in an appendix to the Disquisitiones gave such a table, which he later enlarged. The most complete tables of this kind are due to H. Goodwin and include the mantissas for all denominators up to 1,024, but these tables are now so rare that they are practically unavailable. Very extensive tables have been computed to determine the exponents to which the number 10 belongs for various moduls. 324 NUMBER THEORY AND ITS HISTORY In arranging these tables one makes use of the fact, which is easily proved, that if 10 belongs to the exponent a (mod m) and the exponent b (modn), then for the least common multiple of m and n as modul, it belongs to an exponent that is the l.c.m. of a and b. It is sufficient, therefore, to tabulate the exponents to which 10 belongs for the various prime powers p a . For p a < 10,000, such tables have been constructed by A. J. C. Cunningham and coworkers. For prime moduls, still more extensive tables with p < 120,000 have been computed; one should mention particularly those by W. Shanks. One may be interested in determining the denominators that yield short periods. Such a study is facilitated through the factorization of the various numbers 10 fc — 1 into prime factors. For the first few exponents one obtains 10 - 1 = 3 2 10 5 - 1 = 3 2 • 41 • 271 10 2 - 1 = 3 2 11 10 6 - 1 = 3 3 • 7 • 11 • 13 • 37 10 3 - 1 = 3 3 37 10 7 - 1 = 3 2 • 239 • 4,649 10 4 - 1 = 3 2 11 • 101 10 8 - 1 = 3 2 • 11 • 73 • 101 • 137 10 9 - 1 = 3 4 • 37 • 333,667 From this table one concludes, for instance, that 7 and 13 are the only primes whose periods have the length 6, while 239 and 4,649 have the period 7, and so on. In the preceding we have limited ourselves exclusively to the case where the base of the number system is 10, but it is evident that the results we have obtained are valid, with very small modifications, for arbitrary base numbers. For example, when examining the Babylonian tables of inverses, one may wish to know which denominators correspond to short periods in the sexagesimal system. The following prime factorizations yield this information: 60 - 1 = 59 60 3 - 1 = 7 • 59 • 523 60 2 - 1 = 59 • 61 60 4 - 1 = 13 • 59 • 61 • 277 60 5 - 1 = 11 • 59 • 1,198,151 THEORY OF DECIMAL EXPANSIONS 325 Problems. 1. Find the length of the decimal period for fractions with the denominators n = 17, n = 31, n = 39, n = 43 and find the corresponding families of mantissas. 2. At which point does the period begin when n = 10!? 3. Find all numbers whose periods are 6 and 12 in a number system with the base 2. 4. In which number systems does a prime power p a give a period of length 2? Bibliography Cunningham, A. J. C, H. J. Wood all, and T. G. Creak: Haupt-exponents, Residue-indices, Primitive Roots and Standard Congruences, London, 1922. Goodwin, H. : A Table of Circles arising from the Division of a Unit or Any Other Whole Number by All the Integers from 1 to 1024, being all the pure decimal quotients that can arise from this source, London, 1823. : A Tabular Series of Decimal Quotients of All Proper Vulgar Fractions of which, when in their lowest terms, neither the numerator nor the denominator is greater than 1000, London, 1823. Stevin, Simon: La Disme. Translation in D. C. Smith, A Source Book in Mathematics, McGraw-Hill Book Company, Inc., New York, 1929. CHAPTER 14 THE CONVERSE OF FERMAT'S THEOREM 14-1. The converse of Fermat's theorem. Fermat's theorem states that for every number a not divisible by the prime p, the congruence a p_1 = 1 (mod p) is satisfied. It is natural to investigate conversely whether the fact that some congruence of this kind holds implies that the modul is a prime. In general such a conclusion is not valid. There exist numbers a and n such that a"- 1 = 1 (modn), a j£ 1 (modn) (14-1) without n being a prime. Several writers have made this observa- tion; for instance, F. Sarrus (1819) noted the congruence 2 340 = 1 (mod 341) where the modul 341 = 11-31 is composite. Another example is 3 90 = 1 (mod 91), 91 = 7-13 and numerous other instances may be given. However, by imposing additional restrictions on the number a in the congruence (14-1), it is possible to express a converse form of the theorem of Fermat. This observation was first made and applied by the French specialist in number theory E. Lucas (1876). His original theorem was Theorem 14-1. When for some number a the congruence a B_1 = 1 (mod n) (14-2) 326 THE CONVERSE OF FERMAT'S THEOREM 327 holds, while no similar congruence with a lower exponent a 1 = 1 (mod n), n - 1 > t > (14-3) is fulfilled, the modul n is a prime. On the basis of our previous results the proof is immediate. The condition of the theorem states that the number a belongs to the exponent n — 1 (modn). But the highest exponent to which a can belong is <p(w). We recall further that „(„)_„(!_!). ..(,_£) where the pi's are the different primes dividing n so that / 1 \ n (pin) ^ n ( 1 ) = n ^ n — 1 \ Pi/ Pi This shows that one can have (p(n) = n — 1 only when n = pi is a prime. When it comes to the actual verification that a number is a prime, Lucas's theorem is not very practical in the form in which it stands. However through a few further remarks it may be effectively improved upon. First, if a congruence (14-3) should hold for some exponent t, the number a will belong to an exponent d less than n — 1. According to the congruence (14-2), d would divide n — 1. Instead of investigating all congruences (14-3), therefore, it is sufficient to examine whether such a congruence can hold when the exponent is a proper divisor of n — 1. Second, one need not consider all divisors t of n — 1, because when the congruence (14-3) holds for some t, it must be fulfilled for all multiples of t. This leads us to reformulate the theorem of Lucas as follows: Theorem 14-2. Let n be some integer and q x , q 2 , • • ■ , q s 328 NUMBER THEORY AND ITS HISTORY the different prime factors dividing n — 1. If for some number a the congruence a n-i = i (mod n) holds, while none of the congruences n-\ a 1 (mod n) i = 1, 2, • • • , s (14-4) are fulfilled, the number n is a prime. To prove this statement it suffices to observe that any divisor of n — 1 must divide one of the maximal divisors n — 1 n — 1 so that when a congruence (14-3) holds for some exponent t dividing n — 1, at least one of the congruences (14-4) must be satisfied. To apply the theorem one selects some number a, usually small, for instance, a = 2 or a — 3, and computes the remainder of the power a n ~ x for the modul n. If the congruence (14-2) should not be fulfilled, one concludes that n is not a prime. The method itself is quite practical. However, it has the disadvantage that when it has been used to decide that some particular number is composite, one is left in the rather curious position of having no clue to what the factors may be. In the other alternative, if it should turn out that the congruence (14-2) is true for some number a, the prime factors of n — 1 must be found and the congruences (14-4) examined. If none of them hold, n is a prime; when one of them is fulfilled, the method gives no final decision and one can try the same procedure for some other number a. When there are few different prime factors of n — 1, the number of congruences (14-4) to be investi- gated is small. This is the case for many of the larger special numbers to which the method has been applied. Lucas's converse form of Fermat's theorem involves the com- THE CONVERSE OF FERMAT'S THEOREM 329 putation of the remainders (mod n) of the high powers of a and it is essential that the work be organized in the most effective manner. One suitable procedure will be illustrated first on the very simple example n = 143 and a = 2. A B C 142 2,116 s -29 71 2,025 = 23 46 35 3,481 s 49 98 = -45 17 900 s 42 84 = -59 8 256 = -30 4 16 2 4 1 (mod 143) The left-hand column is constructed first. It begins with the top entry n — 1 = 142, and each successive number is the quo- tient of the preceding when divided by 2. These entries are the exponents of the various powers to which a = 2 shall be raised in the second column. Here one proceeds from the bottom upward. The lowest entries are a raised to the powers 1, 2, 4, and 8, respec- tively. To obtain the 17th power, the preceding entry, —30, is squared and reduced (mod n) to give 42 as the remainder of the 16th power; this is multiplied by 2 and entered in the third column as the remainder —59 of the 17th power. Similarly by squaring — 59, one has the remainder 49 of the 34th power, which is doubled and entered in the third column for the 35th power. Since finally the computations show that the 142nd power is not congruent to 1, the conclusion is that the number 143 is composite. This example, although trivial, gives the key to the general setup, which is well adapted to machine computation. The third column is largely superfluous and it has been included above only for greater clarity of explanation. We shall give some examples that illustrate the power of the method. 330 NUMBER THEORY AND ITS HISTORY Examples. 1. We take n = 700,001 and use the auxiliary number a - 3. of computations takes the form: The table A B A B 700,000 1 683 564,086 350,000 700,000 341 111,831 175,000 197,937 170 2,222 87,500 182,523 85 686,051 43,750 413,705 42 546,504 21,875 70,917 21 238,260 10,937 481,554 10 59,049 5,468 37,250 5 243 2,734 426,023 2 9 1,367 282,506 1 3 This shows that our number is likely to be a prime. The prime factors of 700,000 are 2, 5, and 7 and the corresponding quotients 350,000, 140,000, 100,000 By similar computations one obtains 3 350, ooo s 700,000 3100,000 = 59^336 (mod 700,001) 3140,000 = 425,344 Since none of these remainders is 1 we conclude that 700,001 is a prime. 2. We want to determine the character of the number 373,831. We use a = 2 and obtain the following table of residues: A B A B 373,830 104,740 365 333,424 186,915 110,115 182 261,278 93,457 327,152 91 323,778 46,728 182,017 45 236,742 23,364 313,895 22 82,163 11,682 140,353 11 2,048 5,841 345,890 5 32 2,920 111,522 2 4 1,460 124,779 1 2 730 205,672 This shows that the number is composite. THE CONVERSE OF FERMAT'S THEOREM 331 Both of the last two examples are trivial in the sense that the numbers examined are within the limits of the prime tables. The importance of the method lies, of course, in the fact that it is applicable to numbers of arbitrary size. D. H. Lehmer and P. Poulet have contributed a valuable adjunct to the method of testing primality by means of the con- verse of Fermat's theorem. Through various ingenious devices they have constructed tables containing the composite numbers n up to 100,000,000 for which the congruence 2 n_1 = 1 (mod n) (14-5) is fulfilled, and for each such n a prime factor is given. The tables of Poulet are somewhat simpler to use than those of Lehmer, which leave out numbers n with prime factors not exceeding 313. To determine whether a number n within the limit of the tables is a prime, one checks first by Poulet's tables whether it is one of the exceptional composite numbers for which (14-5) holds. When this is not the case, n is a prime if and only if the congruence (14-5) is satisfied, and through our previous method the test can be performed fairly quickly. (See Supplement.) Problems. Check by the converse theorem of Fermat whether the following numbers are composite or prime: 1. w = 2 16 + 1 3. n = 300,301 2. n = 1,111,111 4. n = 1,234,567 14-2. Numbers with the Fermat property. We have mentioned in the last section that for certain composite numbers n there may exist numbers a for which a" 1 ' 1 = 1 (mod n) (14-6) Much more remarkable is the fact that one can find numbers n that are not prime such that Fermat's congruence (14-6) is satis- fied for every number a relatively prime to n. Numbers of this kind shall be said to have the Fermat property or, for short, we may call them F numbers. 332 NUMBER THEORY AND ITS HISTORY The existence of F numbers was first pointed out by R. D. Carmichael (1909). The smallest among them is 561 = 3 • 11 • 17 (14-7) and they are on the whole quite rare. Below 2,000 there are only two others, namely, 1,105 = 5-13-17, 1,729 = 7-13-19 Relatively few investigations on F numbers have been made, and little is known about them beyond the properties we shall deduce in the following. From the definition of the universal exponent or indicator \{n) of the number n, we conclude first that a congruence (14-6) can hold for all a's relatively prime to n only when the exponent n — 1 is divisible by X(n). This leads to the basic criterion for an F number: Theorem 14-3. The necessary and sufficient condition for a number n to have the Fermat property is that n = l(modX(n)) (14-8) where X(n) is the universal exponent (mod n). To illustrate the application of this theorem let us verify that the number 561 in (14-7) actually is an F number. We recall the formula for X(n) and find X(561) = [„(3), *>(11), *(17)] = [2, 10, 16] = 80 and corresponding to (14-8) one has 561 = 1 (mod 80) Certain simple properties of the F numbers flow directly from the criterion in theorem 14-3: Theorem 14-4. A number with the Fermat property is odd and equal to a product of different prime factors n = p x p 2 • • -p s (14-9) where the number of primes is at least three. THE CONVERSE OF FERMAT'S THEOREM 333 These results were given first by Carmichael and for the examples of F numbers given above they are evidently fulfilled. For the proof of theorem 14-4 we observe that according to the congruence (14-8), the two numbers n and X(n) cannot have any common factor. The number X(n), as we have mentioned several times before, is always even when n > 2, consequently n is odd. Next let p a be the highest power of some prime p that divides n. The indicator \{n) is divisible by <p(p") =?r- 1 (p-i) so that if a > 1, both n and X(n) would have the factor p. This establishes that an F number has the form (14-9). It remains to prove that n cannot be the product of two different primes. In that case one would have n — P1P2 and the indicator would be X(n) = [pi - 1, p 2 - 1] To fulfill the congruence (14-8) the number n - 1 = P1P2 - 1 = (Pi - 1)P2 + P2 — 1 must be divisible by pi — 1. This is possible only when pi — 1 divides p 2 — 1, and in the same manner one concludes that p 2 — 1 must divide pi — 1. Consequently Pi - 1 = p 2 - 1 and the two prime factors would be equal, contrary to our previous conclusion. On the basis of theorem 14-4 the condition (14-8) for an F number may be reformulated. When n is a product (14-9) of different prime factors, the corresponding indicator is the least common multiple X(n) = [pi - 1, • • • , p s - 1] 334 NUMBER THEORY AND ITS HISTORY The single congruence (14-8) may therefore be replaced by the family of congruences n = l (modp,--l) * = 1,2,...,« (14-10) The F numbers, as we stated, are quite scarce. In the tables by Poulet, which were mentioned in the preceding section, the com- posite numbers n were listed for which the congruence 2 n-i = x ( mo d n ) holds. The F numbers must be found among these entries; they have been especially marked with an asterisk and below 100,000,- 000 one counts a total of 250. A method for constructing F numbers has been given by J. Chernick (1939) and a similar method by S. Sispanov (1941). The three examples we quoted all contain three prime factors, and we shall discuss this case in some detail. Let n = V1P2P3 (14-11) be such an F number. Our first observation is contained in the lemma : Any two of the three numbers Pl - 1, p 2 ~ 1, Ps - 1 (14-12) have the same greatest common divisor. For instance, in the example 1,729 = 7-13-19 one finds (6, 12) = (6, 18) = (12, 18) = 6 To prove the lemma it is sufficient to show that the g.c.d. of any pair of the numbers in (14-12), for instance, d = (pi - 1, p 2 - 1) divides the two others, namely, (pi - 1, p 3 - 1), (P2 - 1, Ps - 1) THE CONVERSE OF FERMAT'S THEOREM 335 or, equivalently, that d divides p 3 — 1. But from the definition of d, it follows that Pisl, p 2 = 1 (mod d) so that according to (14-10) and (14-11) n = P1P2P3 = V3 = 1 (mod d) as required. We use the lemma to write pi — 1 = dP 1} p 2 — 1 = dP 2 , 7>3 — 1 = ^P 3 or pi = 1 + dP 1} p 2 = 1 + dP 2 , p 3 = 1 + dP 3 (14-13) where the numbers Pi, P 2 , P 3 are relatively prime in pairs. This yields X(n) = [pi - 1, p 2 - 1, Pa - 1] = [^1, dP 2 , dP 3 ] = dP x P 2 P 3 and the basic condition (14-8) for an F number takes the form P1P2P3 = 1 (mod dP x P 2 P 3 ) Here we substitute the values (14-13) and expand the left-hand product to obtain d 3 P 1 P 2 P 3 + d 2 (PiP 2 + P1P3 + P2P3) + d{P x + P 2 + P 3 ) + 1 = 1 (mod dP x P 2 P 3 ) This reduces first to d\P x P 2 + PiPs + P2P3) + d(Pi + P 2 + Pa) = (mod dP x P 2 P 3 ) and then again to dCPxPa + P X P 3 + P 2 P 3 ) s - (P x + P 2 + P 3 ) (mod PiP 2 P 3 ) (14-14) To construct P numbers from this condition we proceed as follows. Three positive numbers Pi, P 2 , and P 3 , relatively prime in pairs, are selected. The suitable values for d corresponding to 338 NUMBER THEORY AND ITS HISTORY them are solutions of the linear congruence (14-14). Clearly the coefficient of d is relatively prime to the modul so that there exists a unique smallest positive solution d , and the corresponding general solution becomes d = d + tP x P 2 P 3 (14-15) Since we assume that d is positive, t runs through the series 0, 1, 2, ... . When the value (14-15) for d is substituted in (14-13), we find Pl = 1 + Pi^o + tP 1 2 P 2 P 3 p 2 = 1 + P 2 d + tP x P 2 2 P z t = 0, 1, 2, • • • p 3 = 1 + P 3 do + tP^Ps 2 (14-16) To make the product of these numbers an F number, only one condition remains to be fulfilled : they must all be primes. When the successive values of t are introduced and the character of the resulting three numbers checked against a table of primes, it is usually possible to derive a large set of numbers with the Fermat property. Example. The simplest example is Pi = 1, P 2 = 2, P 3 = 3 and the congruence (14-14) becomes lid = -6 (mod 6) with the smallest positive solution do = 6. These numerical values, when substituted in the formulas (14-16) give pi = 7 + 64, p 2 = 13 + 12t, p 3 = 19 + 18* (14-17) as the possible expressions for the three primes defining the F numbers. For t = Owe find the first F number of this type n = 7 • 13 • 19 = 1,729 an example to which we have already referred. THE CONVERSE OF FERMAT'S THEOREM 337 The first few values of t, such that all three numbers (14-17) are primes, have been tabulated below. t Pi P2 Vz 7 13 19 5 37 73 109 34 211 421 631 44 271 541 811 50 307 613 919 54 331 661 991 55 337 673 1,009 1,514 9,091 18,181 27,271 When * is limited so that the least prime pi does not exceed 10,000, one finds 45 F numbers of the type (14-17). Example. In a second example we take Pi = 1, P 2 = 2, P 3 = 5 The congruence (14-14) becomes I7d = -8 (mod 10) and its least positive solution is d = 6. From (14-16) one deduces the corresponding primes pi = 7 + HW, p 2 = 13 + 20i, p 3 = 31 + 50* For t = 0, one finds the F number n = 7 ■ 13 • 31. A similar procedure may be devised to determine the F numbers with four or more prime factors. Let us mention only the example n = P1P2P3P4 where the primes belong to the series Vl = 7 + Qt, p 2 = 13 + 12*, p 3 = 19 + 18*, p 4 = 37 + 36* (14-18) 338 NUMBER THEORY AND ITS HISTORY The smallest F number of this type n = 7 • 13 • 19 • 37 is obtained for t = 0, and with the limitation p\ < 10,000 one finds 13 more of them. As we remarked earlier, the literature on numbers with the Fermat property is scant and there are several natural questions still awaiting solution. It is not even known whether there are infinitely many F numbers, although this seems probable. To illustrate the difficulty, let us take the F numbers that are the product of three primes of the form (14-17). It is known by the theorem of Dirichlet that one can find an unlimited number of values of t for which one of the numbers in (14-17), for instance, Pi, becomes a prime. But whether one can find infinitely many values of t such that all three numbers simultaneously become primes is a problem beyond the present power of number theory. The F numbers by their definition have a basic property in common with the primes, but in other respects they behave quite differently. For instance, one F number may divide another, as in the example m = 7 • 13 • 19, n 2 = 7 • 13 • 19 • 37 or, more generally, any F number with four prime factors (14-18) is divisible by the F number with the three factors (14-17). An F number can even be the product of two other F numbers; for instance, m = (7 -13 -19) (37 -73 -109) is an example. Problems. Find the general form of three prime factors of an F number corresponding to the following values and determine one or more examples in each case 1. Pi = 1, P 2 = 3, P 3 = 4 2. Pi = 1, P 2 = 2, P 3 = 15 3. Pi = 2, P 2 = 3, P 3 = 5 THE CONVERSE OF FERMAT'S THEOREM 339 Bibliography Carmichael, R. D.: "Note on a New Number Theory Function," Bulletin American Mathematical Society, Vol. 16, 232-238 (1910). : "On Composite Numbers P Which Satisfy the Fermat Congruence a P ~ l = 1 mod P," American Mathematical Monthly, Vol. 19, 22-27 (1912). Chernick, J.: "On Fermat's Simple Theorem," Bulletin American Mathe- matical Society, Vol. 45, 269-274 (1939). Lehmer, D. H.: "On the Converse of Fermat's Theorem," American Mathe- matical Monthly, Vol. 43, 347-354 (1936). Poulet, P. : "Table des nombres composes verificant le theoreme de Fermat pour le modul 2 jusqu'a 100,000,000," Sphinx (Brussels), Vol. 8, 42-52 (1938). Sispanov, S.: "Sobre ios numeros pseudo-primos," Boletin matematico, Vol. 14, 99-106 (1941). CHAPTER 15 THE CLASSICAL CONSTRUCTION PROBLEMS 15-1. The classical construction problems. Quite early, proba- bly in the fifth century b.c, Greek mathematical investigations led to the study of some geometric construction problems that have remained landmarks in the history of mathematics. Three of these have acquired a particular fame . 1. The squaring of the circle. When a circle is given, this prob- lem requires that a square shall be constructed whose area is equal to that of the circle. The same difficulty is involved in the construction of a straight distance equal to the circumference of the circle. 2. The trisection of the angle. This problem demands a method for dividing an arbitrary angle into three equal parts. 3. The doubling of the cube. This problem is sometimes known as the Delian problem. According to tradition, it arose when the Athenians sought the assistance of the oracle at Delos to gain relief from a devastating epidemic. They were advised to double the size of the altar of Apollo, cubical in shape. These problems enjoyed popular fame among the Greeks; we know, for instance, according to a letter from the mathematician Eratosthenes to King Ptolemy of Egypt, that Euripides mentions the Delian problem in one of his tragedies, now lost. Greek geometers also focused their interest on several other construction problems; we mention especially the construction of regular polygons, which we shall discuss in some detail subsequently, and the Platonic bodies or regular polyhedrons. These problems had an inspiring influence and added new 340 THE CLASSICAL CONSTRUCTION PROBLEMS 341 aspects to Greek geometry. Special higher curves were introduced and their properties studied, and by such means the trisection of the angle and the duplication of the cube could be accomplished. However, in the strict Greek sense of construction by compass and ruler, the problems remained unsolved in spite of strenuous and ingenious efforts by the Greek and later geometers. In the seventh and last section of the Disquisitiones arithmeticae, Gauss turns to the problem of constructing regular polygons. It may seem out of order to introduce a geometric topic in a work on number theory; hence Gauss feels obliged to explain: "The reader may be surprised at encountering such an investigation which at first view appears wholly dissimilar to it; but the exposi- tion will show very clearly the actual relation between this topic and the transcendental arithmetic." We shall present a brief account of Gauss's principal results on the construction of regular polygons. For this purpose it is necessary to touch upon some of the principles of geometric con- struction in general. When it is required that a construction shall be performed by compass and ruler, it is assumed that each of these two instruments shall be used only for a single, specific operation: 1. With the compass, circles with given center and radius can be traced. 2. With the ruler, a straight line can be drawn through two given points. In these statements it is tacitly included that one can draw circles with arbitrarily large radii and that straight lines can be prolonged indefinitely. Any points or lengths one can deduce from given geometric quantities by a finite number of these two operations are said to have been constructed by compass and ruler. It is not permissible to apply the two instruments in any other way; for instance, markings on a ruler cannot be utilized. There exists, for instance, a very simple solution of the trisection problem by means of a ruler with two fixed marks. While we are on the subject of geometric constructions, let us 342 NUMBER THEORY AND ITS HISTORY take a small step out of the direct path and mention the rather interesting fact that any construction that can be performed by compass and ruler can be made by compass alone, and also, if a fixed circle has been drawn, the constructions may be achieved by ruler only. After the basic rules for the construction by means of compass and ruler have been clarified, the next move in the analysis of the construction problems consists in bringing them in relation to the theory of algebraic equations. It must be emphasized that the subsequent presentation is essentially expository and that some of the most important steps can only be stated here without any attempts to give proofs. To determine which quantities can be constructed, let us assume that one performs the geometric operations within a coordinate system in the plane and examine the algebraic operations involved in each step. When two points are given by means of their coordinates, the coefficients of the equation of the straight line passing through them can be computed rationally from the coordi- nates; dually, when the coefficients of the two straight lines are known, the coordinates of their intersection point can be deter- mined rationally from them. The calculation of the intersection points of a circle and a straight line, or of a circle with another circle, leads to a second-degree equation. The coordinates, there- fore, are obtained as the sum of a rational expression in the known coefficients of the equations and the square root of such an expres- sion. The distance between two points is also expressible as a square root. Since all other constructions can be composed of a series of these simple operations, we conclude from our observations that those magnitudes that can be constructed from given ones may be computed algebraically by repeated applications of the four arithmetic operations and by extracting square roots. But the converse is also true. When a and b are two given lengths, one obtains the distances a ± b as well as ab and a/b by elementary constructions while the square root Va is the result of taking the me?*n proportional of 1 and a. THE CLASSICAL CONSTRUCTION PROBLEMS 343 To summarize: The geometric quantities that are constructible from known data by means of compass and ruler correspond algebraically to those expressions that may be deduced from given numbers by repeated use of the four rational operations and square root extraction. Through this analysis we have succeeded in transferring the construction problems to questions in the theory of equations, since it is relatively easy to show that each constructible expression is the root of an algebraic equation whose coefficients are rational in the given quantities. One way of finding such an equation is the following: Our constructible expression contains a number of square roots. Related expressions can be deduced from it by changing the ± signs in front of each of these radicals in all possible ways. The equation whose roots are all these quantities is an equation of the desired kind. For instance, the quantity x = aV3 satisfies the equation x 2 ~ 3a 2 = The expression x = l + Vs - V5 is a root of the equation of fourth degree [(x - l) 2 - 3] 2 - 5 = x 4 - 4x 3 + 8x - 1 = This transformation makes it clear that to decide on the possi- bility of solving a construction problem, one must examine first whether the quantity to be found satisfies an algebraic equation, and second whether this equation has a constructible solution, or, as one prefers to say in equation theory, whether it is solvable by square roots. The further problem of solving an equation by square roots or, more generally, by radical expressions could not be tackled until the discovery by the two young geniuses, N. H. Abel (1802- 1829), Norwegian, and E. Galois (1811-1832), French, of the principles underlying the solution of algebraic equations. It is impossible to discuss these theories here; we will only say that they have been fundamental in the history of the newer phases of 344 NUMBER THEORY AND ITS HISTORY algebra and gave rise to the all-pervading mathematical concept of groups. For our purpose a few very simple facts will suffice. We have seen that any constructible expression satisfies an algebraic equation with coefficients that are rational in the given quantities. There may be several such equations, but among them there is one of minimal degree, which cannot be factored further with rational coefficients, and it divides all other equations of the same kind. From the theory of Galois it follows that for this minimal equation to be solvable by square roots it must have very special properties. One of these is that its degree must be a power of two. We return to the three classical construction problems, and consider first the duplication of the cube. The given cube may have the side a and the doubled cube the side b. Since the volume of one cube is to be the double of the other, they must fulfill the condition b 3 = 2a 3 or b = v^-a Therefore, the problem is essentially to construct the number x = ^2, which is a root of the equation x 3 - 2 = This equation cannot be factored into rational factors, and since its degree is not a power of 2, we conclude that a cube cannot be doubled by means of a construction with compass and ruler. The impossibility of a general construction for the trisection of the angle can be deduced by a similar argument. An angle a can be constructed when one knows cos a (or sin a) because a occurs in the right triangle with the hypotenuse 1 and one leg equal to cos a. Conversely, when an angle is given, its cosine or sine can be constructed. The problem of trisection of an angle may therefore be expressed: It is required to construct the number x = cos - when the number a = cos a is known. By means of o THE CLASSICAL CONSTRUCTION PROBLEMS 345 the elementary trigonometric formula cos 39 = 4 cos 3 — 3 cos one finds -\ 3 " « cos a = 4 ( cos - ) — 3 cos - a = 4 ( cos i) and this may be rewritten as a cubic equation 4a: 3 — 3x — a = In general, one cannot decompose this equation further into factors whose coefficients depend rationally on a; there are numer- ous values. of a, in fact infinitely many rational values of a, within any interval such that the equation cannot be factored rationally. Since the equation is cubic, we conclude that a general construc- tion for trisecting an angle by compass and ruler cannot be found. The quadrature of the circle is a problem on a different level of difficulty. It is equivalent to finding a construction for the number t, the proportion between the circumference and the diameter of a circle. There is no algebraic equation that is naturally associated with this problem, and the final result is actually to the effect that not only is ir not constructive but it is a transcendental number, i.e., not the root of any algebraic equation with rational coefficients. The proof was found in 1882 by the German mathematician F. Lindemann, and it was based on methods devised previously by the French mathematician C. Hermite, who, in 1873, showed that the number e, the base of the natural logarithms, is a transcendental number. The detailed proofs of the impossibility of constructing solutions to the three classical problems leave nothing to be desired in regard to mathematical stringency. Nevertheless, every mathe- matician has received and undoubtedly will continue to receive new and ingenious constructions purporting to be exact solutions. Usually they have been tested by the inventor on large-scale drawings and the proof of the pudding lies in the eating: no percep- tible error has been found. All of these constructions are, need- 346 NUMBER THEORY AND ITS HISTORY less to say, approximations with errors that are small but definite and computable by elementary trigonometry. Some of the published constructions are of interest due to their simplicity and great accuracy. Any one of them can be improved upon by further complications. Mathematically, an accuracy that leaves no errors observable by the naked eye is not impressive. For instance, t would be constructive if one were permitted to cut off its expansion after the first hundred or first thousand decimals; even by trial and error, the stage of error not perceptible to the eye is reached in a few steps. 15-2. The construction of regular polygons. We now come to the principal topic of this chapter, Gauss's investigations on the construction of regular polygons. A regular polygon with n sides has its vertices equidistant on a circle. The size of the circle is unessential so that we shall assume that its radius is r = 1. Since each of the sides of the polygon corresponds to a central angle 360° _ 2t n n the problem is to divide a full angle of 360° into n equal parts. Any angle can be bisected, so that when a regular polygon with n sides has been obtained, one can successively construct one with 2n, 4n, . . . , in general, with 2 M n sides. On the other hand, from a polygon with 2n sides, one can draw one with n sides by joining every second vertex by a side. Consequently, if one so desires, one can limit the considerations only to regular polygons with an odd number of sides. From the fact that regular polygons with 3, 4, and 5 sides can be constructed, it follows that all polygons with 2", 3-2", 5-2" sides are obtainable. It is evident that if one has a polygon with n sides and a is a divisor of n, say, n = ab, a polygon with a sides can be derived by taking every bth vertex. More interesting is the fact that the basic result on linear indeterminate equations under certain circum- THE CLASSICAL CONSTRUCTION PROBLEMS 347 stances permits us to proceed the other way and obtain polygons with a larger number of sides. From polygons with a and with b sides, where a and b are rela- tively prime, a polygon with ab sides is obtainable. To prove the statement we recall that one can find such integers x and y that ax — by = 1 Division by ab gives JL _ - _ U. ab b a or 360° 360° 360° — — = x—7 y ab b a This shows that the central angle for a polygon with ab sides is the difference between two multiples of the central angles of the poly- gons with a and b sides. For instance, from the polygons with 3 and 5 sides, a polygon with 15 sides is constructive. One concludes also that it would suffice to study the construction of polygons for which the number of sides is an odd prime power. The construction of a polygon with n sides, or equivalently, an angle 2ir/n, may be achieved by using one of the trigonometric functions of the angle, for instance, cos — or sin — (15-1) n n By means of the law of cosines one finds the expression / 2^ Sn = ^2-2cos- for the side of the polygon. Instead of dealing with these quanti- ties directly, Gauss takes a step that at the time was an innova- tion: Imaginary or complex numbers are introduced to solve a problem that essentially concerns real quantities. 348 NUMBER THEORY AND ITS HISTORY Let us recall briefly a few properties of complex numbers. Any such number can be written a + ib — r (cos <p + i sin <p), V=i (15-2) where a and b are the coordinates in the complex plane, r the radius vector or absolute value, while <p is the angle or amplitude Fig. 15-1. Fig. 15-2. that the radius vector makes with the real axis. A complex number (15-2) is multiplied by another a\ -f- ib\ = ri(cos<pi + isin^) according to the rule (a + ib) (ai + ibx) = rr^cos (<p + vi) + i sin (<p + ^?i)] When this result is applied to a product of n equal factors (15-2), one derives the formula (a + ib) n = r n (cos n<p + i sin rup) (15-3) known as the theorem of de Moivre. Gauss assumes that a circle with radius 1 and center at the zero point has been drawn in the complex plane. In this circle he inscribes a regular polygon with n sides such that one vertex THE CLASSICAL CONSTRUCTION PROBLEMS 349 lies on the positive real axis at the point x = 1 (see Fig. 15-1). Then the next vertex will correspond to the complex number e = cos - — V i sin — (15-4) n n and the subsequent ones to 4tt , . . 4x e 2 = cos h i sin — , • • • , n n e = cos — (n - 1) + i sin — (n - 1) (15-5) n n The theorem of de Moivre shows that these numbers are powers of e eo = e o = l, €l = e, e 2 = eV • • , *„_! = e"" 1 (15-6) From the same formula (15-3) we conclude further e n = ( cos — + i sin — ) = cos 2tt + i sin 2tt = 1 \ n n / so that e n = 1 This result establishes that e as well as all its powers (15-6) must be roots of the algebraic equation x n - 1 = (15-7) For this reason one calls the roots (15-6) the nth roots of unity, while the equation (15-7) is known as the equation of the division of the circle or the cyclotomic equation. The two trigonometric functions (15-1), on which the construc- tion of the regular polygon depends, occur as the components of the nth roots of unity (15-4). When they can be expressed by square root operations, the same is true for e, recalling that i = \/~^l. Therefore, if the regular polygon with n sides can be constructed with compass and ruler, the corresponding cyclotomic equation (15-7) can be solved by square roots. Equation (15-7) is not the equation of minimal degree that the nth root of unity e satisfies, since it can be factored rationally; 350 NUMBER THEORY AND ITS HISTORY for instance, x — 1 is an obvious factor. In general, the roots (15-6) of the cyclotomic equation fall into two groups. Some of them cannot be roots of unity for a smaller exponent than n; these are usually called the primitive roots. Others do satisfy equations of the type (15-7) with lower exponents and these are the nonprimitive roots. We may remark that these primitive roots constitute a different, although related, concept from the primitive roots we introduced previously when studying the residue classes of the integers for some modul. It is simple to decide when a root of unity . 2irk , . . 2irk ... „ _ Ck = e = cos 1- t sin (15-8) n n is primitive. If it should satisfy an equation x* = 1, t < n the theorem of de Moivre shows that . 2irkt . 2irkt ek = cos 1- % sin = 1 n n This is only possible if the amplitude n ht 2t — n is an integral multiple of 2x; in other words the number kt must be divisible by n. When k is relatively prime to n, the smallest t that will satisfy this condition is t = n, while a smaller t can be found when k and n have a common factor. Thus we have : An nth root of unity e^, defined in (15-8), is primitive only when k is relatively prime to n. Since the roots in (15-6) that are primitive correspond to those numbers k that are less than and relatively prime to n, we can state further: The number of primitive nth roots of unity is equal to (p(n), where <p denotes Euler's function. THE CLASSICAL CONSTRUCTION PROBLEMS 351 The subsequent step in the algebra of the roots of unity is to demonstrate that the <p(n) primitive roots satisfy an equation with rational coefficients of degree <p(n), and that this equation cannot be factored further rationally. Again we must abstain from giving a proof. To this minimal equation for the primitive roots, we apply our previous criterion limiting the degree of an equation solvable by square roots. This produces the interesting result: For the equation of the nth roots of unity to be solvable by means of square roots, it is necessary that <p(ri) be a power of 2. This places a strong restriction on the number n. To analyze its implications, let n = 2>i ai • • • Vr ar (15-9) be the prime factorization of n. The number <p(n) = 2 Q ^V ai ~~ 1 (Pi -I)'" Pr^HPr - 1) can be a power of 2 only when each of its factors is such a power. One concludes first that none of the odd prime factors pi can occur, so that all exponents a x , . . . , a r in (15-9) must be equal to 1. Second, the numbers pi — 1 are powers of 2; hence the odd primes dividing n are of the form Vi = 2* + 1 (15-10) But these are actually the Fermat primes, which were examined in Chap. 4. We found that such a number as (15-10) cannot be a prime except when the exponent is itself a power of 2 and that the Fermat primes, therefore, are defined by an expression F t = 2 2t + 1 We mentioned also that so far the study of these numbers has revealed only five Fermat primes, namely, Fq = 3, F x = 5, F 2 = 17, F s = 257, F 4 = 65,537 Through these observations we have arrived at Gauss's funda- mental result: A regular polygon with n sides can be constructed by compass 352 NUMBER THEORY AND ITS HISTORY and ruler only when the number n is of the form n = 2 a pip 2 ' • -Vr where the prime factors are Fermat primes. Our previous discussion has been directed towards showing that this condition is necessary. Gauss proves conversely that it is also a sufficient one, by demonstrating that a polygon with p sides can be constructed when p is a Fermat prime. In this case he finds that the equation for the primitive pth roots of unity can be solved by a series of second-degree equations. We shall not go through the details of the general proof, but only consider a couple of examples sufficient to clarify the underlying principles. Problem. Find all polygons with less than 100 sides that can be constructed with compass and ruler. 15-3. Examples of constructible polygons. When p is a prime, the number of primitive pth roots of unity must be <p(p) = p — 1, and clearly the only nonprimitive root is x = 1. Since they all satisfy the equation x p - 1 = the primitive ones are the roots of xP ~ ] = x p - x + x p - 2 H \-x 2 + x+l=0 (15-11) x — i These roots, as we mentioned, are all some power of 2tt . . 2tt e = cos V i sin — V V We notice further that the two roots ft 27T 27T e = cos — fc + isin — k V V e 7 ' - * = e = cos — k — i sin — k p p THE CLASSICAL CONSTRUCTION PROBLEMS 353 are conjugate imaginary, and their sum e k + <T k = 2 cos — k V is real. In particular 2t v = e + e _1 = 2 cos — > (15-12) P and this number may serve to construct the polygon. For the smallest Fermat prime p = 3, (15-11) becomes x 2 + x + 1 = We substitute x = e and obtain after division by 6 v + 1 = 6 + t~ l + 1 = According to (15-12), this gives 2tt 1 cos ¥ --- and for the side of the polygon, one finds the value s 3 = V3 The next Fermat prime is p = 5. Here e satisfies the equation e 4 + e 3 + e 2 + e + 1 = and division by e 2 yields e 2 + e~ 2 + e + e- 1 + 1 = (15-13) From we obtain, by squaring, V = € + € _1 v 2 _ 2 = e 2 + e~ 2 When these values are substituted into (15-13), it follows that rj is the root of the second-degree equation ^ 2 + ^-l=0 354 NUMBER THEORY AND ITS HISTORY The solution of this equation is VI - 1 where we have taken the plus sign for the square root since 77 is positive according to (15-12). We obtain further 2tt VI - 1 cos — = 5 4 and the side of the pentagon is computed to be S5 = i V 10 - 2v"5 In our last example we take the Fermat prime p = 17, and in this case the principles of the general theory emerge more clearly. When the number is excluded, the sixteen other remainders (mod 17) may be written ±1, ±2, ±3, ±4, ±5, ±6, ±7, ±8 (15-14) We shall first divide these numbers into two classes ±1, ±2, ±4, ±8 (15-15a) ±3, ±5, ±6, ±7 (15-156) The numbers in (15-1 5a) are known as the quadratic residues (mod 17) ; they are obtained by squaring the numbers in (15-14) and taking the remainders (mod 17). The remaining numbers in (15-14), which have been put in the set (15-156) are the quadratic nonresidues. One should notice that the numbers in (15-156) can be derived from those in (15-15a) by multiplication with some nonresidue, for instance, 3. Second, the remainders (15-14) shall be distributed into four classes, each of four numbers (15-16o) (15-166) (15-16c) (15-16d) ±1, ±4 ±2, ±8 ±3, ±5 ±6, ±7 THE CLASSICAL CONSTRUCTION PROBLEMS 355 Here the first set consists of the remainders of the fourth powers of the numbers in (15-14) or, equivalently, of the squares of the numbers in (15-1 5a). They are called the biquadratic residues. To obtain (15-166), the numbers in (15-16a) are multiplied by some number in (15-15a) not already in (15-16o), for instance, 2. The numbers in (15-16c) follow from (15-16a) through multipli- cation by some number not in the two preceding groups, and (15-16d) is derived similarly. Through a third division the remainders (15-14) fall into eight sets of two numbers. Here we use the basic group ±1, namely, the residues of the eighth powers of the numbers in (15-14). By this process the first set (15-16a) splits into ±1 and ±4, and the other sets in (15-16) are divided similarly. After these preliminaries we turn to the solution of (15-11) f or p = 17. When the root x = e is substituted and the equation divided by e 8 , it follows that e + 6 -l + € 2 + e -2 + . . . + e 8 + 6 "8 = _1 (15-17) At this stage Gauss introduces two quantities which he calls the first periods p = e + e - 1 + e2 + € - 2 + 64 + e - 4 + e s + e - 8 | pi = e 3 + e" 3 + e 5 + e~ 5 + e 6 + e" 6 + e 7 + e' 7 ] These periods, as one sees, are the sums of the roots whose expo- nents are the numbers in the two classes (15-1 5a) and (15-156). Both periods are real, for instance 2t 4t , n 8x 16tt p = 2 cos — + 2 cos — + 2 cos — + 2 cos — — 1/ 17 1< 1< and it is readily checked that p is positive and pi negative. The periods (15-18) are the roots of an equation of second degree r(x) = (x - p)(x - pi) = x 2 - (p + pi)x + ppi (15-19) which we shall show has rational coefficients. From (15-17) and (15-18) one concludes immediately P + pi = — 1 356 NUMBER THEORY AND ITS HISTORY The computation of the product of the two periods (15-18) is somewhat more cumbersome. By direct multiplication one obtains 8 • 8 = 64 products, each a power of e. One verifies that every term e k with k ^ occurs equally often and, since there are 16 different powers, each of them appears four times. According to (15-17) we conclude that PPi = -4 These investigations show that the equation (15-19) has the form x 2 + x - 4 = and its roots are p = 17 1 — j -Vii - l Pi = (15-20) (15-21) In the next step we study the second periods 0l = e 2 + e- 2 + e 8 + e~ 8 a2 = e 3 + € "3 + e 5 + e -5 ^ = € 6 + -6 + e 7 + -7 Here the various sets (15-16) serve as the exponents for the terms in periods. The periods are all real, for instance, 2tt 8tt n a = cos — + cos — > Similarly one finds that o- 2 is positive while a x and o- 3 are negative. The four periods (15-21) in pairs, a, a x and o- 2 , <r 3 , are roots of second-degree equations whose coefficients can be expressed by the first periods. From (15-21) and (15-18) one sees that <t + o\ = P, 02 + 03 = Pi and by multiplication from (15-17) ere - ! 0'2 O '3 = — 1 THE CLASSICAL CONSTRUCTION PROBLEMS 35? so that the two quadratic equations are x 2 - px - I = 0, x 2 - Pl x - 1 = For the solution of these equations, one finds by our previous remark about the signs of the periods P + vV + 4 p - Vp^Tl a = } di = Pi + Vpi 2 + 4 _ pi - vV + 4 *2 = g ' *3 - ~ 2 Here one can substitute the values (15-20) for p and p x to obtain the explicit expressions for the second periods; for instance, a = i(\/l7 - 1 + ^34 - 2N/17), ff2 = |(-Vl7 - 1 + ^34 + 2\/l7) (15-22) Finally the third-order periods should be computed. We shall need only two of them, namely, , = e + e" 1 = 2cos^> ,1 = e 4 + e~ 4 = 2 cos ^ (15-23) where the exponents are taken from (15-16a). Again these two quantities satisfy a second-degree equation whose coefficients can be expressed by means of the second periods. From (15-23) one obtains . V + Vi = °"> VVi = °2 and the equation is X 2 — (XX + 02 = The expressions (15-23) show that v > Vi, and therefore the solu- tion of the quadratic equation gives us 77 = 2 cos — = 2ir o- + V(T 2 - 4ff 17 2 Here the values (15-22) may be substituted, and the final formula in terms of square roots will emerge. The reader may compute 358 NUMBER THEORY AND ITS HISTORY the length of the side s 17 of the regular polygon with 17 sides. Various fairly simple methods of construction have been devised. After having completed these investigations, towards the end of the Disquisitiones, the young Gauss states with justifiable pride: There is certainly good reason to be astonished that while the division of the circle in 3 and 5 parts having been known already at the time of Euclid, one has added nothing to these discoveries in a period of two thousand years and that all geometers have considered it certain that, except for these divisions and those which may be derived from them (divisions into 2 M , 15, 3 • 2 M , 5 • 2 M , 15 • 2 M parts), one could not achieve any others by geometric constructions. It has been told that Gauss proposed, perhaps not too seri- ously, that a polygon with 17 sides be inscribed on his grave, emulating the tombstone of Archimedes, which was decorated by a figure of a sphere and the circumscribed cylinder, suggesting his formula for the area of a sphere. OnjGauss's simple grave in Gottingen there is no such polygon, but it does appear on the monument in his native town of Brunswick. Gauss's results on the construction of regular polygons by compass and ruler represent a great achievement, but the final solution of the problem is not yet in sight. Gauss transfers the whole question to number theory, to the determination of the Fermat primes. Whether there exist any others than the five we have mentioned, no one knows. It is possible that the new electronic computing devices may be of assistance in discovering others. But the general problems, for instance, the question whether there might be an infinite number of Fermat primes, lie beyond the reach of the present methods of number theory. Bibliography Dickson, L. E.: Modern Algebraic Theories, Benj. H. Sanborn & Co., New York, 1930. MacDuffee, C. C: An Introduction to Abstract Algebra, John Wiley & Sons, Inc., New York, 1940. Rouse-Ball, W. W. : Mathematical Recreatians and Essays. Revised by H. S. M. Coxeter, eleventh edition, The Macmillan Company, New York, 1939. Thomas, J. M. : Theory of Equations, McGraw-Hill Book Company, Inc., New York, 1938. SUPPLEMENT RECENT NUMERICAL RESULTS The predictions about the usefulness of the electronic com- puters for calculations in number theory have been amply fulfilled since the manuscript for this book was first prepared. Several interesting computations, vastly beyond the range of ordinary calculating machines have been carried out by means of various types of electronic computers and more will undoubtedly follow. Since such studies are not income-producing tasks many have been achieved in the hours of the night where the machines would otherwise have been idle. All have been repeated and checked, sometimes on different computers with new programming and other operators, since men and machines tend to fall into errors of habit and constitution. Mersenne primes. Among the most formidable of these calcu- lations is the search for new Mersenne primes M p = 2? - 1 Professor D. H. Lehmer has made a wide sweep for possible primes M p and he announced in 1952 and 1953 that the values corresponding to p = 521, 607, 1,279, 2,203, 2,281 are primes. For the last two of these Mersenne primes, after coding and preparations, the actual running time of the SWAC calculator amounted to 59 and 66 minutes, respectively. In comparison with these giants the Mersenne prime M m given on page 73 appears quite puny. The Mersenne prime M 2 ,28i is a number with 687 digits. Professor H. S. Uhler has taken the trouble of calculating explicitly the new perfect numbers corre- sponding to these primes. 359 359a NUMBER THEORY AND ITS HISTORY Various conjectures have been made about Mersenne primes, but as far as they have been checked none of them seems to have any validity. It has been noticed, for instance, that when the Mersenne primes V = 3, 7, 31, 127 are used as exponents in M p they give new Mersenne primes. This is no general rule, however, since Professor R. M. Robinson recently announced that calculations carried out on an ILLIAC machine by D. J. Wheeler show that for the Mersenne prime p — 8,191 the corresponding M p is not a prime. In this connection let us also mention that the Fermat numbers F n = 2 2n + 1 have been further examined, but no new primes have been found. One of the latest results is an actual factor of Fi . Bibliography Uhleb, H. S.: "A brief history of the investigations on Mersenne numbers and the latest immense primes," Scripta Mathematica, Vol. 18, 122-131 (1952). Uhler, H. S.: "On the 16th and 17th perfect numbers," Scripta Mathe- matica, Vol. 19, 128-131 (1953). Bang, T.: "Store primtal (Large primes)," N ordisk M atematisk Tidskrift, Vol. 2, 157-168 (1954). Robinson, R. M.: "Mersenne and Fermat numbers," Proceedings of the American Mathematical Society, Vol. 5, 842-846 (1954). Odd perfect numbers. A great variety of results have been obtained on the possible forms of odd perfect numbers, particu- larly by A. Brauer and H. J. Kanold. It has also been shown by Kanold [Journal fur die reine und angewandte Mathematik, Vol. 186, 25-29 (1944)] that there are no odd perfect numbers below 1.4 X 10 14 . One of my students, J. B. Muskat, has informed me that he has been able to raise this bound to 10 18 . GENERALIZATIONS OF THE PERFECT NUMBERS New li?ts of multiply perfect numbers have recently been published by B. Franqui and M. Garcia [American Mathematical SUPPLEMENT 359b Monthly, Vol. 60, 169-171 (1953)] and also by A. L. Brown [Scripta Mathematica, Vol. 20, 103-106 (1954)] adding more than 200 such numbers to those previously known. In this con- nection let us also mention a list by P. Poulet [Scripta Mathe- matica, Vol. 14, 77 (1948)] over new couples of amicable numbers. Another generalization of the perfect numbers has been sug- gested by the author. It is not difficult to prove that for a perfect number n the harmonic mean H(n) of the divisors of n as defined in Sec. 5.1 is always an integer, while for other numbers this is only rarely the case. Thus the integers with integral harmonic mean for the divisors may be considered a generalization of the perfect numbers. They seem to share the property that they are all even. This has been checked by M. Garcia for all such numbers up to 10,000,000. Bibliography Ore, O.: "On the averages of the divisors of a number," American Mathematical Monthly, Vol. 55, 615-619 (1948). Garcia, M.: "On numbers with integral harmonic mean," American Mathematical Monthly, Vol. 61, 89-96 (1954). Prime tables. Based on calculations by Kulik, Poletti, and Porter a new prime table covering the 11th million has been published by N. G. Beeger (Amsterdam, 1951). There are 61,938 primes in the 11th million. It may also be mentioned that lists of prime twins up to 200,000 have been prepared by E. S. Selmer and G. Nesheim [Det Kongelige Norske Videnskabers Selskabs, Forhandlinger Trondheim, Vol. 15, 95-98 (1942)] and up to 300,000 by H. Tietze [Sitzungsberichte der mathematisch- naturwisse'nschaftlichen Klasse der bayerischen Akadamie der Wissenschaften zu Munchen, 57-72 (1947)]. We indicated in Sec. 14.1 how tables of the composite numbers n, satisfying the congruence 2 «-i = l(mod n) (1) were an essential aid to the factorization of large numbers. D. H. Lehmer [American Mathematical Monthly, Vol. 56, 300-309 359c NUMBER THEORY AND ITS HISTORY (1949)] has extended these tables to n = 200,000,000 by means of the Army Ordnance ENIAC computer. Sierpinsky pointed out that there is an infinity of composite numbers satisfying (1), and later Lehmer and P. Erdos proved that there is an infinity of such numbers with any given number of prime factors [Ameri- can Mathematical Monthly, Vol. 56, 623-624, (1949)]. Fermat's problem. The studies on Fermat's problem have been continued quite intensively, both in theory and by means of high-speed computers. Among the most notable contributions are those by Professor H. S. Vandiver and the numerical calcula- tions carried out by D. H. Lehmer, Emma Lehmer, and J. Self- ridge at his suggestion. It is shown that the equation x n + y n = z n n > 2 (2) can have no nonzero integral solutions for any value of n < 2,521. In this case the extensive calculations have had the ideal effect of bringing in new points of view also in regard to the theoretical problems. "Thanks to SWAC for special exponents we have really come to grips with the Fermat problem," as Vandiver expresses it [Proceedings of the National Academy of Science, Vol. 40, 474-480 (1954)]. (Word has just been received from Professor Vandiver that a series of calculations on Fermat's theorem by C. A. Nicol and J. Selfridge has been completed. It has been verified that Fermat's theorem is true for all exponents up to n = 4,000.) A number of improved estimates of the lowest possible values of the numbers x, y, and z in a possible solution of (2) have also been made, particularly by Oblath and Inkeri. On the basis of Vandiver's calculations and new estimating methods by Duparc and Wijngaarden these values could again be raised essentially. However, there does not seem to be much point in continuing along these lines; Oblath observes in connection with his own estimates that x and y would have to exceed a number which at good speed would take more than two centuries to write and a strip of 4,000 miles to print. GENERAL BIBLIOGRAPHY For a complete, encyclopedic account of the history of the discoveries in number theory up to 1918 the reader is referred to: Dickson, L. E.: "History of the Theory of Numbers," 3 vols., Carnegie Institution of Washington Publication 256, 1919-1923. A review of the existing table material on number-theory questions can be found in: Lehmer, D. H.: "Guide to the Tables in the Theory of Numbers," National Research Council Bulletin 105, Washington, 1941. A considerable selection of translations and reproductions of essential con- tributions to number theory is contained in : Smith, D. E. : A Source Book in Mathematics, McGraw-Hill Book Company, Inc., New York, 1929. The following is a list of English books on number theory for the reader who wishes to pursue the subject further : Carmichael, R. D.: Theory of Numbers, John Wiley & Sons, Inc., New York, 1914. : Diophantine Analysis, John Wiley & Sons, Inc., New York, 1915. Dickson, L. E. : Introduction to the Theory of Numbers, University of Chicago Press, Chicago, 1929. -.Studies in the Theory of Numbers, University of Chicago Press, Chicago, 1930. : Modern Elementary Theory of Numbers, University of Chicago Press, Chicago, 1939. Hardy, G. H. and E. M. Wright: An Introduction to the Theory of Numbers, Oxford University Press, New York, 1938. Ingham, A. E. : The Distribution of Prime Numbers, Cambridge University Press, London, 1932. Uspensky, J. V., and M. A. Heaslet: Elementary Number Theory, McGraw- Hill Book Company, Inc., New York, 1939. Wright. H. N. : First Course in Theory of Numbers, John Wiley & Sons, Inc., New York, 1939. 359eZ NAME INDEX Abel, N. H., 343 Abu Kamil, 139, 140 Abu-1-Hasan Thabit ben Korrah, 98,99 Ahmes, 116-118 Albert, A. A., 39, 164 Alcuin, 94, 121 Al-Karkhi, 185-187, 225 Al-Khowarizmi, Mohammed ibn Musa, 19, 20, 187, 225 Archibald, R. C, 141 Archimedes, 5, 140, 209, 358 Aristotle, 26 Aryabhata, 122 Athelard of Bath, 20 B Bachet, Claude, Sisur de M5ziriac, 125, 126, 132, 133, 141, 196, 198 Barlow, 93, 131 Bede, Venerable, 6 Bell, E. T., 39 Bertelsen, 69, 77 Bhaskara, 26, 122, 123, 129, 136, 138, 193, 208 Birkhoff, G., 39, 164 Bonconpagni, B., 207 Brahmagupta, 26, 122, 193, 208, 247, 249 Brancker, 53 Briggs, 317 Brun, V., 84 Buddha, 4 Bull, L. S., 141 Burckhardt, 54 C Cajori, F., 24 Cardanus, 98, 195 Carmichael, R. D., 96, 207, 332, 333, 339, 359 Cataldi, 73 Chace, A. B., 141 Charlemagne, 94, 121 Chaucer, 20 Chernac, 54 Chemick, J., 334, 339 Chuquet, Nicolas, 98 Colebrook, H. T., 141, 208 Copernicus, Nikolaus, 21 Coxeter, H. S. M., 358 Crelle, 54 Creak, T. G., 310, 325 Cunningham, A. J. C, 85, 96, 285, 310, 324, 325 D Dase, 54 De Moivre, 348-350 Descartes, Rene, 55, 95, 96, 99 Dickson, L. E., 199, 358, 359 361 362 NUMBER THEORY AND ITS HISTORY Diophantos, 168, 179-185, 187, 193- 196, 198, 199, 203-205, 208, 211, 268, 270, 313 Dirichlet, Lejeune, 79, 80, 206, 207, 268 E Eratosthenes, 64, 66, 67, 75, 84, 340 Escott, E. B., 100, 115 Etienne de la Roche, 98 Euclid, 41Jf., 52, 65, 79, 92, 94, 174, 211, 358 Euler, Leonhard, 59-64, 73, 74, 78, 81, 84, 93, 100, 110, 126-128, 131, 132, 138, 141, 198, 199, 206, 208, 211, 245, 249, 272, 273, 277, 297 Euripides, 340 F Felkel, 54 Ferdinand, Carl Wilhelm, Duke of Brunswick, 209, 210 Fermat, Pierre de, 54-59, 62, 63, 69, 73-75, 80, 95, 96, 98, 99, 166, 194, 196, 198, 199, 203-209, 211, 268, 270-273, 277, 280 Fermat, Samuel, 196 Fibonacci (see Leonardo) Frederic II, Emperor, 187, 193 Frederic II, King of Prussia, 60 Frenicle de Bessy, 59, 60, 74, 96, 272 G Galois, E., 343, 344 Gauss, C. F., 74, 75, 209-212, 225, 233, 245, 247, 256, 263, 266, 267, 291, 297, 301, 315, 317, 323, 341, 346-348, 351, 352, 355, 358 Gelon, King, 5 Gerbert, Pope Sylvester II, 20 Glaisher, J. W. L., 54, 95, 113, 115 Goldbach, Christian, 60, 81, 84, 85 Goodwin, H., 323, 325 H Hadamard, J., 78 Hardy, G. H., 39, 40, 199, 359 Heaslet, M. A., 39, 40, 43, 359 Heath, T. L., 208 Henry, Charles, 208 Heraclitus, 195 Hermite, C, 345 Hilbert, D., 199 Hill, G E., 24 Holzman, 194-196 Hopper, V. F., 40 Iamblichus of Chalcis, 97 Ibn Khaldun, 97 Ingham, A. E., 359 Jacobi, K. G. J., 285, 301, 310 Jenkinson, 9re. John of Halifax, 21 John of Palermo, 188, 193 Jumeau, Andre, 96 K Karpinski, L. C, 24 Kraitchik, M., 76, 85, 285, 310 Kronecker, 43 Kulik, J. P., 54 Kummer, E., 206, 207 Lagrange, J. L., 199, 211, 256, 259, 282 Lambert, J. H., 53 Lame, 43, 206 Lawther, H. P., Jr., 305, 309, 310 Legendre, 206, 211 NAME INDEX 363 Lehmer, D. H., 54, 75n., 331, 339, 359 Lehmer, D. N., 54, 66, 85, 96 Leibniz, 55, 259 Leonardo Fibonacci (Pisano),20, 117, 118, 122, 185, 187, 188, 191-193, 196, 202, 207, 228, 247, 312 Lindemann, F., 345 Littlewood, J. E., 199 Lucas, E., 73, 96, 326-328 M MacDuffee, C. C, 40, 164, 358 MacLane, S., 39, 164 Mahaviracarya, 122, 131, 141 Manning, H. P., 141 Martin, A., 169 Mason, D. E., 96 Meissel, 69, 77 Mendelsohn, I., 175 Mersenne, 53, 55, 59, 69, 71-73, 75, 92-96, 99 Mills, W. H., SOn. Mohammed ibn Musa al-Khowarizmi (see Al-Khowarizmi) Mordell, L. J., 208 N Napier, John, 24 Napoleon, 199, 209 Neugebauer, O., 171, 172, 176, 208 Newton, 55, 209 Nonius, 195 P Pacioli, Luca di Burgo, In. Paganini, Nicolo, 100 Pascal, 55, 74 Pell, John, 53 Pervouchine, 73 Peter II, 60 Philo Judaeus, 27 Pipping, W., 84 Pisano (see Leonardo) Plato, 26, 166 Pliny, 6 Poulet, P., 71, 96, 100, 115, 331, 334, 339 Poullet-Delisle, A. C. M., 233 Powers, 73 Proclus, 166 Ptolemy, King, 340 Pythagoras, 165, 166 R Rahn, 53 Rangacarya, M., 141 Recorde, Robert, 21 Regiomontanus, 141, 194, 249 Reisch, Gregor, 22 Rhind, Henry, 116 Riemann, G. F. B., 78 Robert of Chester, 20 Roberval, 198 Rohnius (see Rahn) Rouse-Ball, W. W., 24, 358 Rudolff, Christoff, 122, 195, 313 S Sachs, A., 176, 208 Sacrobosco (see John of Halifax) Sanford, V., 314rc. Sarrus, F., 326 Seelhoff, 73 Shanks, W., 324 Shodja, C. Aslam (see Abu Kamil) Sispanov, S., 334, 339 Smith, D. E., 7, 24, SUn., 325, 359 Stevin, Simon, 24, 313-315, 325 Stiefel, Michael, 98, 195 Sun-tse, 245, 247 Sylvester II, Pope (see Gerbert) Tannery, Paul, 208 Tartaglia, 98 364 NUMBER THEORY AND ITS HISTORY Thales of Miletus, 174 Theodoras, Master, 187 Thomas, J. M., 358 Thue, A., 268 Thureau-Dangin, F., 171, 208 U Uhler, 73 Uspensky, J. V., 39, 40, 43, 359 V Valee-Poussin, C. J., de la, 78 Vandiver, H. S., 208 Venerable Bede (see Bede) Villefranche (see Etienne de la Roche) Vinogradoff, I., 85, 199 W Waring, Edward, 199, 259 Welser, Marcus, 14 Wilson, John, 259 Woepke, F., 208 Wolfskehl, 207 Woodall, H. J., 310, 325 Wright, E. M., 39, 40, 359 Wright, H. N., 359 X Xylander (see Holzmann) SUBJECT INDEX Abacists, 21, 185 Abacus, 14, 15, 225, 227 Absolute value, 28, 348 Absorption law, 103 Abundant numbers, 94, 95 Al-Fakhri, 185, 187, 193, 208 Algebra (Euler), 60, 126, 128, 132, 138, 141, 206 Algebra, 20, 123 syncopated, 181 Algebraic congruences, 234, 235, 249-258 Algebraic numbers, 206, 207 Algorism, 20, 21 (See also Euclid's algorism) Algorismus, 21 Aliquot parts, 86, 91, 98 Al-Jabr wal-Muqabalah, 19, 20, 187 Al-Kafi fil hisab, 185 Amicable numbers, 27, 96-100 Amplitude, 348, 350 Apices, 20 Arabic numerals, 19, 24, 117 Arithmetic (Sun-Tse), 245 Arithmetic, 180 Arithmetic mean, 90, 91 Arithmetic series, 79 Arithmetics (Diophantos), 180-185, 194, 199, 270 Associative law, 48, 103 Astrology, 28 Attic numerals, 11, 15 Average, 90 B Babylonian numerals and system, 2, 16-18, 36, 37, 172-179, 188, 312, 324 Base (of number systems), 3 Bija-Ganita, 123, 136, 193 Binary number systems, 2, 37 Billion, 5 Book of Precious Things in the Art of Reckoning, The, 139 Brahma-Sphuta-Siddhanta, 122, 193 Brahmi numerals, 19 Bureau, 15 C Calculations, 14, 15 Calculus, 15, 55 Canon arithmeticus, 285, 301 Casting, on the lines, 15, 225, 227 out nines, 15, 225, 227, 229-231 Cattle problem, 140 Checks, 15 numerical, 225-233 Chinese remainder theorem, 240, 246-248, 251, 264, 265, 294, 304 Chinese- Japanese numerals, 11, 12, 16, 17 Cipher, 11, 20 Ciphered numerals, 12-13, 19 365 366 NUMBER THEORY AND ITS HISTORY Closed systems of numbers, 158-163 Cogita Physico-malhematica, 71 Columna Rostrata, 4 Commutative law, 103 Complete Introduction to Algebra (see Algebra, Euler) Complex numbers, 158-163, 347, 348 Composite numbers, 50, 51, 331 Comptoir, 15 Congruences, 210^. algebraic, 234, 235, 249-258 linear, 236-240, 275, 276, 298, 299 root of, 234#. simultaneous, 240-250 Congruent, 21 1#. Congruum, 191, 202 Construction by compass and ruler, 341-345, 349, 351, 352 Cossica, or Cossick Art, 195 Counters, 1, 15, 21, 227 Counting process, 1, 8 Cross-cut, 105 Cuttaca, 122 Cycle, solar, lunar, planetary, 247 Cyclotomic equation, 349 D Decadic number systems, 1, 3, 12, 33, 34, 226, 233, 279 Decimal, circulating, 315 Decimal expansion, 311-325 finite, 315-317 periodic, 318-325 purely periodic, 320, 321 Decimal fractions, 21, 36, 311-326 Decimal number systems, 1, 3, 10, 34, 36 Deficient numbers, 94, 95 Delian problem (see Doubling of cube) De Moivre, theorem of, 348-350 Demotic numerals, 13 De revolutionibus orbium coelestium, 21 De temporum ratione, 6 Determination, 212 De Thiende (see Disme, La) Digits, 1, 16 Diophantine equations or problems, 165, 184, 193, 204, 207, 208, 268 Dirichlet, box principle of, 268 theorem of, 79, 80, 338 Disme, La, 24, 313, 314, 325 Disquisitiones arilhmeticae, 74, 209- 211, 225, 233, 243, 256, 263, 297, 301, 315, 323, 341, 358 Distributive laws, 106, 108 Divisible, 29, 213 Divisibility, 25, 226-228 Division, 25, 30 Division lemma, 44 Divisor, common, 41, 47 greatest common (gc.d.), 25, 41, 47, 48, 100-107, 154 Divisors of a number, 28, 29, 86 arithmetic mean of, 90, 91 average of, 90 geometric mean of, 87, 88, 91 harmonic mean of, 90, 91 maximal, 328 number of, 86 product of, 87 proper, 30 sum of, 88, 89, 95 trivial, 29 Doubling of cube (Delian problem), 340, 341 Dual, 103, 105, 106 Duplication, 38 Dyadic number systems, 2, 37-39 E Elements (Euclid), 41, 52, 65, 92, 166 Eleven, 3 Equivalence relation, 213 Eratosthenes, sieve of, 64, 66, 67, 84 SUBJECT INDEX 367 Euclid's algorism, 41^45, 100, 122, 142, 146, 193 Euler's congruence or theorem, 272- 280, 290, 292, 303 ^function, 109-115, 273, 283, 350 Exchequer, 8, 9, 15 Exponent, to which a number belongs, 280-284 ±1, 302, 303, 309 universal, 290, 292, 293, 302, 332 F Factor, 29 Factor tables, 53, 54, 82, 83, 85 Factorization method, Euler's, 59-64 Fermat's, 54-58, 62 Fermat numbers, 74, 75 primes, 69, 75, 205, 351-354, 358 (See also Numbers, with Fermat property) Fermat's theorem, 272, 273, 277-280, 326, 339 converse of, 326, 328, 331, 339 Fermat's last theorem, 203-208 Field, 163, 164 quadratic, 163 Finger numbers, 5-7 Finite decimal expansion, 315-317 F numbers {see Numbers, with Fer- mat property) Foil, 8 Forms, quadratic, 63 G Greatest common divisor (g.c.d.), 25, 41, 47, 48, 100-107, 154 associative law for, 48, 103 Greek numerals, 11, 13, 15, 28 Ground of Artes, The, 21 H Harmonic mean, 90, 91 Hebrew numerals, 28 Herodianic numerals, 11, 15 Hieratic numerals, 13 Hieroglyphic numerals, 10, 13 Hindu- Arabic numerals, 15, 19, 21, 24, 312 Hindu-Brahmi numerals, 13 Historical Prolegomenon, 97 Horoscope, 97 Hundred, 3 I Ideals, 207 Idempotent law, 103 Incongruent, 211 Indeterminate problems, 120, 182 linear, 120^., 142ff., 160, 184, 193. 237, 276 Indicator, 110, 294, 302, 333 Indices, 294-301, 310, 322, 325 Infinite descent, method of, 198, 200 Integers, 28 greatest, contained in a number, 31 group of, 1, 2, 10-13 Integral logarithm, 77 Intersection, 105, 108 Ganita-Sara-Sangraha, 123, 141 Gauss's generalization of Wilson's con- gruence, 263, 266, 267, 291, 292 Gematry (Gematria), 28 Geometric mean, 87, 88, 91 Geometric progression, 89, 272 Gobar numerals, 20 Goldbach's conjecture, 81, 84, 85 Jetons, 15, 20, 227 Join, 104 L Lattice points, 151, 152 Lattices, 105, 106 Least common multiple (l.c.m.), 25, 45-49, 100-107 368 NUMBER THEORY AND ITS HISTORY Least common multiple (l.c.m.), asso- ciative law for, 48, 103 Liber Abaci, 20, 117, 122, 187, 228, 247 Liber quadratorum, 188, 203 Lilavati, 26, 122, 123 Linear congruences, 236-240, 275, 276, 298, 299 Local value, principle of, 16 Logarithms, 77, 294, 297, 299, 301, 314, 345 Logistics, 181 Lucas, theorem of, 326-328 M Mantissa, 317-319, 322, 323, 325 Mayan numerals, 2, 4, 18 Mean, arithmetic, 90, 91 geometric, 87, 88, 91 harmonic, 90, 91 Mediation, 38 Meditationes algebraicae, 199, 259 Meet, 104 Mersenne primes, 69, 71-73, 92-94 Milliard, 5 Million, 4 Modul, of congruences, 21 1$". of numbers, 159-163, 214 Modulus (see Modul) Multiples, 29 common, 45, 48 least common (l.c.m.), 25, 45-49, 100-107 Multiplicative group, 162, 163, 344 grouping of numerals, 11, 12, 16 Multiplicity, 86 Multiply perfect numbers, 95-96 Myriad, 4 N Neo-Platonic, 97 Neo-Pythagorean, 26 Nim, 39 Nonresidue, quadratic 354 Number, 1 of the Beast, 28 Number systems, 2, 3, 21, 34, 311 Babylonian sexagesimal, 2, 16-18, 36, 37, 172-179, 188, 312, 324 binary, 2, 37 closed, 158-163 decadic, 1, 3, 12, 33, 34, 226, 233, 279 decimal, 1, 3, 10, 34, 36 duodecimal, 2 dyadic, 2, 37-39 positional, 16 quinary, 2, 3 ternary, 37 triadic, 37 vigesimal, 2, 18 (See also Numerals) Number theory (Barlow), 93, 131 Number theory, analytic, 76, 78, 85 Numbers, abundant, 94, 95 algebraic, 206, 207 amicable, 27. 96-100 associated, 28, 29 base, 34 binomial, 70 classification of, 158 complex, 158-163, 347, 348 composite, 50, 51, 331 deficient, 94, 95 even, 29, 31 Fermat, 74, 75 with Fermat property (F numbers), 331-339 finger, 5-7 imaginary, 347 Mersenne, 75 multiply perfect, 95, 96 natural, 25, 28 Ixld, 31 perfect, 27, 71, 91, 95 prime, 50-85, 93, 359 rational, 158-164, 319, 320 real, 158-163 SUBJECT INDEX 369 Numbers, regular, 174, 316 transcendental, 345 Numerals, 1 alphabetic, 13 Arabic, 19, 24, 117 Attic, 11, 15 Babylonian, 2, 16, 18, 172-179, 312, 324 Brahmi, 19 Chinese- Japanese, 11, 12, 16, 17 Chinese mercantile, 12 ciphered, 12-13, 19 Demotic, 13 Gobar, 20 Greek, 11, 13, 15, 28 Hebrew, 28 Herodianic, 11, 15 Hieratic, 13 hieroglyphic, 10, 13 Hindu-Arabic, 15, 19, 21, 24, 312 Hindu-Brahmi, 13 Mayan, 2, 4, 18 with multiplicative grouping, 11, 12, 16 positional, 16, 18, 19, 312 Roman, 8, 10, 14, 21 with simple grouping, 10, 11, 16, 18 Sumerian, 16 Numerical checks, 225-233 Numerology, 25-27, 39, 91, 94, 98 O On the Creation of the World, 27 Palatine Anthology, 132, 180 Papyrus Rhind, 116, 117, 119, 141 Parts, 91 Periodic decimal expansion, 318-325 Perfect numbers, 27, 71, 91, 95 Periods, first, second, third (Gaus- sian), 355-357 Platonic bodies, 340 Plimpton Library tablet, 170, 175,176 Polygonal numbers, 180 Polyhedrons, regular, 340 Polygons, regular, 340 construction of, 74, 340, 346-358 Porisms, 180 Prime, even, 50 factorization, 50, 51 factors, determination of, 52 number theorem, 77, 78 numbers, 50-85, 93, 359 relatively, 41, 50 tables, 66, 67, 69, 76, 85 twins, 76 Primes, distribution of, 75, 76, 78 Fermat, 69, 75, 205, 351-354, 358 infinitude of, 65 Mersenne, 69, 71-73, 92-94 Primitive roots (see Roots, primitive) Primitive solutions, 167-169, 178,190, 191, 200 Problems (see Indeterminate prob- lems) Problemes plaisans, 125, 141 Pulverizer, 122, 193 Puzzles, 116|f. Pythagorean school, 26, 27, 97, 165, 166, 174, 195 triangle and theorem, 165-170, 177-184, 189, 190, 200, 202, 203 Q Quadratic, fields, 163 forms, 63 Quadrillion, 5 Quinary number systems, 2, 3 Quipu, 8 Quotient, 30 R Radius vector, 348 Rational numbers, 158-164, 319, 320 Ray, 161 370 NUMBER THEORY AND ITS HISTORY Real numbers, 158-163 Reckoning coins, 15 Reckoning Manual, 313 Reflexivity, 212 Reformation, 28 Regular numbers, 174, 316 Remainder, 30 least absolute, 32, 43, 215 least positive, 30 Republic, 26 Residue, biquadratic, 355 . class, 214-216 quadratic, 354 systems, 213-216 Riemann's hypothesis, 78 Ring, 161-163 Roman indication, 247 Roots, primitive, for a modul, 284- 302, 310, 325 of unity, 349-352 nonprimitive, 350 primitive, 350, 352 Roman numerals, 8, 10, 14, 21 Rules of Coss, 313 Russian multiplication, 38, 39 S Sand Reckoning, The, 5 Score, 2, 8 Self-dual, 107 Set operations, 105, 108 Seven, 27, 117 Simultaneous congruences, 240-250 Soroban, 15 Spread, 306-309 Squaring of the circle, 340, 345 Stock, 8 Structures, 105 Subtraction principle, 10 Sum, 105, 108 of three or four squares, 198 of two squares, 60-63, 196-198, 203. 267-271 Sumerian numerals, 16 Surd, 195 Swanpan, 15 Symmetry, 212 Syncopated algebra, 181 Tablets, cuneiform, Babylonian, 17, 170-179 Talisman, 97 Tallies, 8, 9 exchequer, 8, 9 Telephone cables, splicing of, 302, 305-310 Ten, 3 Thousand, 3 Totient, 110 Transitivity, 212 Trattato de numeri perfelti, 73 Trigonometric functions, 179 Trillion, 5 Trisection of the angle, 340, 341, 344, 345 Tschotu, 15 Twelve, 3 U Union, 104, 105, 108 V Vigesimal number systems, 2, 18 W Wilson's congruence or theorem, 259-263, 266, 278 Gauss's generalization of, 263, 266, 267, 291, 292 Zero, 6, 18-20 residue class, 215 Zeta function, Riemann's, 78