This action might not be possible to undo. Are you sure you want to continue?

David A. SANTOS

dsantos@ccp.edu

January 2, 2010 REVISION

Copyright c (2007 David Anthony SANTOS. Permission is granted to copy, distribute and/or modify this document

under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free

Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the

license is included in the section entitled “GNU Free Documentation License”.

GNU Free Documentation License

Version 1.2, November 2002

Copyright c 2000,2001,2002 Free Software Foundation, Inc.

51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The purpose of this License is to make a manual, textbook, or other functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either

commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modiﬁcations made by others.

This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not

limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited

in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the

work in a way requiring permission under copyright law.

A “Modiﬁed Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modiﬁcations and/or translated into another language.

A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains

nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or

with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not ﬁt the above deﬁnition of

Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover

Text may be at most 25 words.

A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose speciﬁcation is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for

images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy

made in an otherwise Transparent ﬁle format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modiﬁcation by readers is not Transparent. An image format is not Transparent if used for any substantial amount

of text. A copy that is not “Transparent” is called “Opaque”.

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF

designed for human modiﬁcation. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD

and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such,

“Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text.

A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a speciﬁc section name

mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this deﬁnition.

The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming

warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies,

and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange

for copies. If you distribute a large enough number of copies you must also followthe conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly

and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all

words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim

copying in other respects.

If the required texts for either cover are too voluminous to ﬁt legibly, you should put the ﬁrst ones listed (as many as ﬁt reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location

from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps,

when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or

retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

iii

iv

You may copy and distribute a Modiﬁed Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modiﬁed Version under precisely this License, with the Modiﬁed Version ﬁlling the role of the

Document, thus licensing distribution and modiﬁcation of the Modiﬁed Version to whoever possesses a copy of it. In addition, you must do these things in the Modiﬁed Version:

A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as

a previous version if the original publisher of that version gives permission.

B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modiﬁcations in the Modiﬁed Version, together with at least ﬁve of the principal authors of the Document (all of its principal authors, if it has

fewer than ﬁve), unless they release you from this requirement.

C. State on the Title page the name of the publisher of the Modiﬁed Version, as the publisher.

D. Preserve all the copyright notices of the Document.

E. Add an appropriate copyright notice for your modiﬁcations adjacent to the other copyright notices.

F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modiﬁed Version under the terms of this License, in the form shown in the Addendum below.

G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice.

H. Include an unaltered copy of this License.

I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modiﬁed Version as given on the Title Page. If there is no section Entitled “History” in the

Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modiﬁed Version as stated in the previous sentence.

J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in

the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.

K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.

L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.

M. Delete any section Entitled “Endorsements”. Such a section may not be included in the Modiﬁed Version.

N. Do not retitle any existing section to be Entitled “Endorsements” or to conﬂict in title with any Invariant Section.

O. Preserve any Warranty Disclaimers.

If the Modiﬁed Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do

this, add their titles to the list of Invariant Sections in the Modiﬁed Version’s license notice. These titles must be distinct from any other section titles.

You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modiﬁed Version by various parties–for example, statements of peer review or that the text has been approved by an organization as the

authoritative deﬁnition of a standard.

You may add a passage of up to ﬁve words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modiﬁed Version. Only one passage of Front-Cover Text and one of Back-Cover

Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add

another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modiﬁed Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms deﬁned in section 4 above for modiﬁed versions, provided that you include in the combination all of the Invariant Sections of all of the original

documents, unmodiﬁed, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each

such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice

of the combined work.

In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”.

You must delete all sections Entitled “Endorsements”.

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that

you followthe rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim

copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used

to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the

Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the

aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modiﬁcation, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may

include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that

you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version

will prevail.

If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights

under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

10. FUTURE REVISIONS OF THIS LICENSE

v

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or

concerns. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document speciﬁes that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either

of that speciﬁed version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by

the Free Software Foundation.

Que a quien robe este libro, o lo tome prestado y no lo devuelva, se le convierta en una serpiente en las

manos y lo venza. Que sea golpeado por la parálisis y todos sus miembros arruinados. Que languidezca

de dolor gritando por piedad, y que no haya coto a su agonía hasta la última disolución. Que las polillas

roan sus entrañas y, cuando llegue al ﬁnal de su castigo, que arda en las llamas del Inﬁerno para siempre.

-Maldición anónima contra los ladrones de libros en el monasterio de San Pedro, Barcelona.

vi

Contents

Preface

These notes started in the summer of 1993 when I was teaching Number Theory at the Center for Talented Youth Summer

Program at the Johns Hopkins University. The pupils were between 13 and 16 years of age.

The purpose of the course was to familiarise the pupils with contest-type problem solving. Thus the majority of the prob-

lems are taken from well-known competitions:

AHSME American High School Mathematics Examination

AIME American Invitational Mathematics Examination

USAMO United States Mathematical Olympiad

IMO International Mathematical Olympiad

ITT International Tournament of Towns

MMPC Michigan Mathematics Prize Competition

(UM)

2

University of Michigan Mathematics Competition

STANFORD Stanford Mathematics Competition

MANDELBROT Mandelbrot Competition

Firstly, I would like to thank the pioneers in that course: Samuel Chong, Nikhil Garg, Matthew Harris, Ryan Hoegg, Masha

Sapper, Andrew Trister, Nathaniel Wise and Andrew Wong. I would also like to thank the victims of the summer 1994: Karen

Acquista, Howard Bernstein, Geoffrey Cook, Hobart Lee, Nathan Lutchansky, David Ripley, Eduardo Rozo, and Victor Yang.

I would like to thank Eric Friedman for helping me with the typing, and Carlos Murillo for proofreading the notes.

Due to time constraints, these notes are rather sketchy. Most of the motivation was done in the classroom, in the notes

I presented a rather terse account of the solutions. I hope some day to be able to give more coherence to these notes. No

theme requires the knowledge of Calculus here, but some of the solutions given use it here and there. The reader not knowing

Calculus can skip these problems. Since the material is geared to High School students (talented ones, though) I assume very

little mathematical knowledge beyond Algebra and Trigonometry. Here and there some of the problems might use certain

properties of the complex numbers.

A note on the topic selection. I tried to cover most Number Theory that is useful in contests. I also wrote notes (which I

have not transcribed) dealing with primitive roots, quadratic reciprocity, diophantine equations, and the geometry of numbers.

I shall ﬁnish writing them when laziness leaves my weary soul.

I would be very glad to hear any comments, and please forward me any corrections or remarks on the material herein.

David A. SANTOS

dsantos@ccp.edu

vii

Chapter 1

Preliminaries

1.1 Introduction

We can say that no history of mankind would ever be complete without a history of Mathematics. For ages numbers have

fascinated Man, who has been drawn to them either for their utility at solving practical problems (like those of measuring,

counting sheep, etc.) or as a fountain of solace.

Number Theory is one of the oldest and most beautiful branches of Mathematics. It abounds in problems that yet simple to

state, are very hard to solve. Some number-theoretic problems that are yet unsolved are:

1. (Goldbach’s Conjecture) Is every even integer greater than 2 the sum of distinct primes?

2. (Twin Prime Problem) Are there inﬁnitely many primes p such that p +2 is also a prime?

3. Are there inﬁnitely many primes that are 1 more than the square of an integer?

4. Is there always a prime between two consecutive squares of integers?

In this chapter we cover some preliminary tools we need before embarking into the core of Number Theory.

1.2 Well-Ordering

The set N = ¦0, 1, 2, 3, 4, . . .¦ of natural numbers is endowed with two operations, addition and multiplication, that satisfy the

following properties for natural numbers a, b, and c:

1. Closure: a +b and ab are also natural numbers.

2. Associative laws: (a +b) +c = a + (b +c) and a(bc) = (ab)c.

3. Distributive law: a(b +c) = ab +ac.

4. Additive Identity: 0 +a = a +0 = a

5. Multiplicative Identity: 1a = a1 = a.

One further property of the natural numbers is the following.

1 Axiom (Well-Ordering Axiom) Every non-empty subset S of the natural numbers has a least element.

As an example of the use of the Well-Ordering Axiom, let us prove that there is no integer between 0 and 1.

2 Example Prove that there is no integer in the interval ]0; 1[.

1

2 Chapter 1

Solution: Assume to the contrary that the set S of integers in ]0; 1[ is non-empty. Being a set of positive integers, it must

contain a least element, say m. Now, 0 < m

2

< m < 1, and so m

2

∈ S. But this is saying that S has a positive integer m

2

which is smaller than its least positive integer m. This is a contradiction and so S =∅.

We denote the set of all integers by Z, i.e.,

Z =¦. . . −3, −2, −1, 0, 1, 2, 3, . . .¦.

A rational number is a number which can be expressed as the ratio

a

b

of two integers a, b, where b = 0. We denote the set of

rational numbers by Q. An irrational number is a number which cannot be expressed as the ratio of two integers. Let us give

an example of an irrational number.

3 Example Prove that

√

2 is irrational.

Solution: The proof is by contradiction. Suppose that

√

2 were rational, i.e., that

√

2 =

a

b

for some integers a, b. This implies

that the set

A =¦n

√

2 : both n and n

√

2 positive integers¦

is nonempty since it contains a. By Well-Ordering A has a smallest element, say j = k

√

2. As

√

2−1 > 0,

j(

√

2−1) = j

√

2−k

√

2 = ( j −k)

√

2

is a positive integer. Since 2 < 2

√

2 implies 2 −

√

2 <

√

2 and also j

√

2 = 2k, we see that

( j −k)

√

2 = k(2 −

√

2) < k(

√

2) = j.

Thus ( j −k)

√

2 is a positive integer in A which is smaller than j. This contradicts the choice of j as the smallest integer in A

and hence, ﬁnishes the proof.

4 Example Let a, b, c be integers such that a

6

+2b

6

= 4c

6

. Show that a = b = c = 0.

Solution: Clearly we can restrict ourselves to nonnegative numbers. Choose a triplet of nonnegative integers a, b, c satisfying

this equation and with

max(a, b, c) > 0

as small as possible. If a

6

+2b

6

= 4c

6

then a must be even, a = 2a

1

. This leads to 32a

6

1

+b

6

= 2c

6

. Hence b = 2b

1

and so

16a

6

1

+32b

6

1

= c

6

. This gives c = 2c

1

, and so a

6

1

+2b

6

1

= 4c

6

1

. But clearly max(a

1

, b

1

, c

1

) < max(a, b, c). This means that all of

these must be zero.

5 Example (IMO 1988) If a, b are positive integers such that

a

2

+b

2

1 +ab

is an integer, then

a

2

+b

2

1 +ab

is a perfect square.

Solution: Suppose that

a

2

+b

2

1 +ab

= k is a counterexample of an integer which is not a perfect square, with max(a, b) as small as

possible. We may assume without loss of generality that a < b for if a = b then

0 < k =

2a

2

a

2

+1

< 2,

which forces k = 1, a perfect square.

Now, a

2

+b

2

−k(ab +1) = 0 is a quadratic in b with sum of the roots ka and product of the roots a

2

−k. Let b

1

, b be its

roots, so b

1

+b = ka and b

1

b = a

2

−k.

As a, k are positive integers, supposing b

1

< 0 is incompatible with a

2

+b

2

1

= k(ab

1

+1). As k is not a perfect square,

supposing b

1

= 0 is incompatible with a

2

+0

2

= k(0 a +1). Also

b

1

=

a

2

−k

b

<

b

2

−k

b

< b.

Practice 3

Thus we have found another positive integer b

1

for which

a

2

+b

2

1

1 +ab

1

= k and which is smaller than the smallest max(a, b). This

is a contradiction. It must be the case, then, that k is a perfect square.

Practice

Problem 1.2.1 Find all integer solutions of a

3

+2b

3

= 4c

3

. Problem 1.2.2 Prove that the equality x

2

+y

2

+z

2

=2xyz can

hold for whole numbers x, y, z only when x = y = z = 0.

1.3 Mathematical Induction

The Principle of Mathematical Induction is based on the following fairly intuitive observation. Suppose that we are to perform

a task that involves a certain number of steps. Suppose that these steps must be followed in strict numerical order. Finally,

suppose that we know how to perform the n-th task provided we have accomplished the n −1-th task. Thus if we are ever able

to start the job (that is, if we have a base case), then we should be able to ﬁnish it (because starting with the base case we go to

the next case, and then to the case following that, etc.).

Thus in the Principle of Mathematical Induction, we try to verify that some assertion P(n) concerning natural numbers is

true for some base case k

0

(usually k

0

= 1, but one of the examples below shows that we may take, say k

0

= 33.) Then we try

to settle whether information on P(n −1) leads to favourable information on P(n).

We will now derive the Principle of Mathematical Induction from the Well-Ordering Axiom.

6 Theorem (Principle of Mathematical Induction) If a setS of non-negative integers contains the integer 0, and also con-

tains the integer n +1 whenever it contains the integer n, then S = N.

Proof: Assume this is not the case and so, by the Well-Ordering Principle there exists a least positive integer k

not in S. Observe that k > 0, since 0 ∈ S and there is no positive integer smaller than 0. As k −1 < k, we see that

k −1 ∈ S. But by assumption k −1 +1 is also in S, since the successor of each element in the set is also in the

set. Hence k = k −1 +1 is also in the set, a contradiction. Thus S =N. u

The following versions of the Principle of Mathematical Induction should now be obvious.

7 Corollary If a set A of positive integers contains the integer m and also contains n+1 whenever it contains n, where n > m,

then A contains all the positive integers greater than or equal to m.

8 Corollary (Principle of Strong Mathematical Induction) If a set A of positive integers contains the integer m and also

contains n +1 whenever it contains m+1, m+2, . . . , n, where n > m, then A contains all the positive integers greater than or

equal to m.

We shall now give some examples of the use of induction.

9 Example Prove that the expression

3

3n+3

−26n −27

is a multiple of 169 for all natural numbers n.

Solution: For n = 1 we are asserting that 3

6

−53 = 676 = 169 4 is divisible by 169, which is evident. Assume the assertion is

true for n −1, n > 1, i.e., assume that

3

3n

−26n −1 = 169N

for some integer N. Then

3

3n+3

−26n −27 = 27 3

3n

−26n −27 = 27(3

3n

−26n −1) +676n

4 Chapter 1

which reduces to

27 169N+169 4n,

which is divisible by 169. The assertion is thus established by induction.

10 Example Prove that

(1 +

√

2)

2n

+ (1 −

√

2)

2n

is an even integer and that

(1 +

√

2)

2n

− (1 −

√

2)

2n

= b

√

2

for some positive integer b, for all integers n ≥1.

Solution: We proceed by induction on n. Let P(n) be the proposition: “(1+

√

2)

2n

+ (1−

√

2)

2n

is even and (1+

√

2)

2n

− (1−

√

2)

2n

= b

√

2 for some b ∈ N.” If n = 1, then we see that

(1 +

√

2)

2

+ (1 −

√

2)

2

= 6,

an even integer, and

(1 +

√

2)

2

− (1 −

√

2)

2

= 4

√

2.

Therefore P(1) is true. Assume that P(n −1) is true for n > 1, i.e., assume that

(1 +

√

2)

2(n−1)

+ (1 −

√

2)

2(n−1)

= 2N

for some integer N and that

(1 +

√

2)

2(n−1)

− (1 −

√

2)

2(n−1)

= a

√

2

for some positive integer a.

Consider now the quantity

(1 +

√

2)

2n

+ (1 −

√

2)

2n

= (1 +

√

2)

2

(1 +

√

2)

2n−2

+ (1 −

√

2)

2

(1 −

√

2)

2n−2

.

This simpliﬁes to

(3 +2

√

2)(1 +

√

2)

2n−2

+ (3 −2

√

2)(1 −

√

2)

2n−2

.

Using P(n −1), the above simpliﬁes to

12N+2

√

2a

√

2 = 2(6N+2a),

an even integer and similarly

(1 +

√

2)

2n

− (1 −

√

2)

2n

= 3a

√

2+2

√

2(2N) = (3a +4N)

√

2,

and so P(n) is true. The assertion is thus established by induction.

11 Example Prove that if k is odd, then 2

n+2

divides

k

2

n

−1

for all natural numbers n.

Solution: The statement is evident for n = 1, as k

2

−1 = (k −1)(k +1) is divisible by 8 for any odd natural number k because

both (k −1) and (k +1) are divisible by 2 and one of them is divisible by 4. Assume that 2

n+2

[k

2

n

−1, and let us prove that

2

n+3

[k

2

n+1

−1. As k

2

n+1

−1 = (k

2

n

−1)(k

2

n

+1), we see that 2

n+2

divides (k

2n

−1), so the problem reduces to proving that

2[(k

2n

+1). This is obviously true since k

2n

odd makes k

2n

+1 even.

Mathematical Induction 5

12 Example (USAMO 1978) An integer n will be called good if we can write

n = a

1

+a

2

+ +a

k

,

where a

1

, a

2

, . . . , a

k

are positive integers (not necessarily distinct) satisfying

1

a

1

+

1

a

2

+ +

1

a

k

= 1.

Given the information that the integers 33 through 73 are good, prove that every integer ≥33 is good.

Solution: We ﬁrst prove that if n is good, then 2n +8 and 2n +9 are good. For assume that n = a

1

+a

2

+ +a

k

, and

1 =

1

a

1

+

1

a

2

+ +

1

a

k

.

Then 2n +8 = 2a

1

+2a

2

+ +2a

k

+4 +4 and

1

2a

1

+

1

2a

2

+ +

1

2a

k

+

1

4

+

1

4

=

1

2

+

1

4

+

1

4

= 1.

Also, 2n +9 = 2a

1

+2a

2

+ +2a

k

+3 +6 and

1

2a

1

+

1

2a

2

+ +

1

2a

k

+

1

3

+

1

6

=

1

2

+

1

3

+

1

6

= 1.

Therefore,

if n is good both 2n +8 and 2n +9 are good. (1.1)

We now establish the truth of the assertion of the problem by induction on n. Let P(n) be the proposition “all the integers

n, n +1, n +2, . . . , 2n +7” are good. By the statement of the problem, we see that P(33) is true. But (??) implies the truth of

P(n +1) whenever P(n) is true. The assertion is thus proved by induction.

We now present a variant of the Principle of Mathematical Induction used by Cauchy to prove the Arithmetic-Mean-

Geometric Mean Inequality. It consists in proving a statement ﬁrst for powers of 2 and then interpolating between powers of

2.

13 Theorem (Arithmetic-Mean-Geometric-Mean Inequality) Let a

1

, a

2

, . . . , a

n

be nonnegative real numbers. Then

n

√

a

1

a

2

a

n

≤

a

1

+a

2

+ +a

n

n

.

Proof: Since the square of any real number is nonnegative, we have

(

√

x

1

−

√

x

2

)

2

≥0.

Upon expanding,

x

1

+x

2

2

≥

√

x

1

x

2

, (1.2)

which is the Arithmetic-Mean-Geometric-Mean Inequality for n =2. Assume that the Arithmetic-Mean-Geometric-

Mean Inequality holds true for n = 2

k−1

, k > 2, that is, assume that nonnegative real numbers w

1

, w

2

, . . . , w

2

k−1

satisfy

w

1

+w

2

+ +w

2

k−1

2

k−1

≥(w

1

w

2

w

2

k−1 )

1/2

k−1

. (1.3)

Using (??) with

x

1

=

y

1

+y

2

+ +y

2

k−1

2

k−1

and

x

2

=

y

2

k−1

+1

+ +y

2

k

2

k−1

,

6 Chapter 1

we obtain that

y

1

+y

2

+ +y

2

k−1

2

k−1

+

y

2

k−1

+1

+ +y

2

k

2

k−1

2

≥

Å

(

y

1

+y

2

+ +y

2

k−1

2

k−1

)(

y

2

k−1

+1

+ +y

2

k

2

k−1

)

ã

1/2

.

Applying (??) to both factors on the right hand side of the above , we obtain

y

1

+y

2

+ +y

2

k

2

k

≥(y

1

y

2

y

2

k )

1/2

k

. (1.4)

This means that the 2

k−1

-th step implies the 2

k

-th step, and so we have proved the Arithmetic-Mean-Geometric-

Mean Inequality for powers of 2.

Now, assume that 2

k−1

< n < 2

k

. Let

y

1

= a

1

, y

2

= a

2

, . . . , y

n

= a

n

,

and

y

n+1

= y

n+2

= = y

2

k =

a

1

+a

2

+ +a

n

n

.

Let

A =

a

1

+ +a

n

n

and G = (a

1

a

n

)

1/n

.

Using (??) we obtain

a

1

+a

2

+ +a

n

+ (2

k

−n)

a

1

+ +a

n

n

2

k

≥

a

1

a

2

a

n

(

a

1

+ +a

n

n

)

(2

k

−n)

1/2

k

,

which is to say that

nA+ (2

k

−n)A

2

k

≥(G

n

A

2

k

−n

)

1/2

k

.

This translates into A ≥G or

(a

1

a

2

a

n

)

1/n

≤

a

1

+a

2

+ +a

n

n

,

which is what we wanted.u

14 Example Let s be a positive integer. Prove that every interval [s; 2s] contains a power of 2.

Solution: If s is a power of 2, then there is nothing to prove. If s is not a power of 2 then it must lie between two consecutive

powers of 2, i.e., there is an integer r for which 2

r

< s < 2

r+1

. This yields 2

r+1

< 2s. Hence s < 2

r+1

< 2s, which gives the

required result.

15 Example Let M be a nonempty set of positive integers such that 4x and [

√

x] both belong to M whenever x does. Prove

that M is the set of all natural numbers.

Solution: We will prove this by induction. First we will prove that 1 belongs to the set, secondly we will prove that every power

of 2 is in the set and ﬁnally we will prove that non-powers of 2 are also in the set.

Since M is a nonempty set of positive integers, it has a least element, say a. By assumption

√

a also belongs to M, but

√

a < a unless a = 1. This means that 1 belongs to M.

Since 1 belongs to M so does 4, since 4 belongs to M so does 4 4 = 4

2

, etc.. In this way we obtain that all numbers of

the form 4

n

= 2

2n

, n = 1, 2, . . . belong to M. Thus all the powers of 2 raised to an even power belong to M. Since the square

roots belong as well to M we get that all the powers of 2 raised to an odd power also belong to M. In conclusion, all powers

of 2 belong to M.

Practice 7

Assume now that n ∈ N fails to belong to M. Observe that n cannot be a power of 2. Since n ∈ M we deduce that

no integer in A

1

= [n

2

, (n +1)

2

) belongs to M, because every member of y ∈ A

1

satisﬁes [

√

y] = n. Similarly no member

z ∈ A

2

= [n

4

, (n +1)

4

) belongs to M since this would entail that z would belong to A

1

, a contradiction. By induction we can

show that no member in the interval A

r

= [n

2

r

, (n +1)

2

r

) belongs to M.

We will nowshowthat eventually these intervals are so large that they contain a power of 2, thereby obtaining a contradiction

to the hypothesis that no element of the A

r

belonged to M. The function

f :

R

∗

+

→ R

x → log

2

x

is increasing and hence log

2

(n +1) −log

2

n > 0. Since the function

f :

R → R

∗

+

x → 2

−x

is decreasing, for a sufﬁciently large positive integer k we have

2

−k

< log

2

(n +1) −log

2

n.

This implies that

(n +1)

2

k

> 2n

2

k

.

Thus the interval [n

2

k

, 2n

2

k

] is totally contained in [n

2

k

, (n +1)

2

k

). But every interval of the form [s, 2s] where s is a positive

integer contains a power of 2. We have thus obtained the desired contradiction.

Practice

Problem 1.3.1 Prove that 11

n+2

+12

2n+1

is divisible by 133

for all natural numbers n.

Problem 1.3.2 Prove that

1 −

x

1!

+

x(x −1)

2!

−

x(x −1)(x −2)

3!

+ + (−1)

n

x(x −1)(x −2) (x −n +1)

n!

equals

(−1)

n

(x −1)(x −2) (x −n)

n!

for all non-negative integers n.

Problem 1.3.3 Let n ∈ N. Prove the inequality

1

n +1

+

1

n +2

+ +

1

3n +1

> 1.

Problem 1.3.4 Prove that

2 +

»

2 + +

√

2

. .. .

n radical signs

= 2cos

π

2

n+1

for n ∈ N.

Problem 1.3.5 Let a

1

= 3, b

1

= 4, and a

n

= 3

a

n−1

, b

n

= 4

b

n−1

when n > 1. Prove that a

1000

> b

999

.

Problem 1.3.6 Let n ∈ N, n > 1. Prove that

1 3 5 (2n −1)

2 4 6 (2n)

<

1

√

3n +1

.

Problem 1.3.7 Prove that if n is a natural number, then

1 2 +2 5 + +n (3n −1) = n

2

(n +1).

Problem 1.3.8 Prove that if n is a natural number, then

1

2

+3

2

+5

2

+ + (2n −1)

2

=

n(4n

2

−1)

3

.

Problem 1.3.9 Prove that

4

n

n +1

<

(2n)!

(n!)

2

for all natural numbers n > 1.

Problem 1.3.10 Prove that the sum of the cubes of three con-

secutive positive integers is divisible by 9.

8 Chapter 1

Problem 1.3.11 If [x[ = 1, n ∈ N prove that

1

1 +x

+

2

1 +x

2

+

4

1 +x

2

+

8

1 +x

8

+ +

2

n

1 +x

2

n

equals

1

x −1

+

2

n+1

1 −x

2

n+1

.

Problem 1.3.12 Is it true that for every natural number n the

quantity n

2

+n +41 is a prime? Prove or disprove!

Problem 1.3.13 Give an example of an assertion which is not

true for any positive integer, yet for which the induction step

holds.

Problem 1.3.14 Give an example of an assertion which is true

for the ﬁrst two million positive integers but fails for every in-

teger greater than 2000000.

Problem 1.3.15 Prove by induction on n that a set having n

elements has exactly 2

n

subsets.

Problem 1.3.16 Prove that if n is a natural number,

n

5

/5 +n

4

/2 +n

3

/3 −n/30

is always an integer.

Problem 1.3.17 (Halmos) ) Every man in a village knows in-

stantly when another’s wife is unfaithful, but never when his

own is. Each man is completely intelligent and knows that ev-

ery other man is. The law of the village demands that when

a man can PROVE that his wife has been unfaithful, he must

shoot her before sundown the same day. Every man is com-

pletely law-abiding. One day the mayor announces that there

is at least one unfaithful wife in the village. The mayor always

tells the truth, and every man believes him. If in fact there

are exactly forty unfaithful wives in the village (but that fact

is not known to the men,) what will happen after the mayor’s

announcement?

Problem 1.3.18 1. Let a

1

, a

2

, . . . a

n

be positive real num-

bers with

a

1

a

2

a

n

= 1.

Use induction to prove that

a

1

+a

2

+ +a

n

≥n,

with equality if and only if a

1

= a

2

= = a

n

= 1.

2. Use the preceding part to give another proof of the

Arithmetic-Mean-Geometric-Mean Inequality.

3. Prove that if n > 1, then

1 3 5 (2n −1) < n

n

.

4. Prove that if n > 1 then

n

Ä

(n +1)

1/n

−1

ä

< 1 +

1

2

+ +

1

n

.

5. Prove that if n > 1 then

1 +

1

2

+ +

1

n

< n

Å

1 −

1

(n +1)

1/n

+

1

n +1

ã

.

6. Given that u, v, w are positive, 0 < a ≤ 1, and that

u +v +w= 1, prove that

Å

1

u

−a

ãÅ

1

v

−a

ãÅ

1

w

−a

ã

≥27 −27a +9a

2

−a

3

.

7. Let y

1

, y

2

, . . . , y

n

be positive real numbers. Prove the

Harmonic-Mean- Geometric-Mean Inequality:

n

1

y

1

+

1

y

2

+ +

1

y

n

≤

n

√

y

1

y

2

y

n

.

8. Let a

1

, . . . , a

n

be positive real numbers, all different. Set

s = a

1

+a

2

+ +a

n

.

(a) Prove that

(n −1)

¸

1≤r≤n

1

s −a

r

<

¸

1≤r≤n

1

a

r

.

(b) Deduce that

4n

s

< s

¸

1≤r≤n

1

a

r

(s −a

r

)

<

n

n −1

¸

1≤r≤n

1

a

r

.

Problem 1.3.19 Suppose that x

1

, x

2

, . . . , x

n

are nonnegative

real numbers with

x

1

+x

2

+ +x

n

≤1/2.

Prove that

(1 −x

1

)(1 −x

2

) (1 −x

n

) ≥1/2.

Problem 1.3.20 Given a positive integer n prove that there is

a polynomial T

n

such that cosnx = T

n

(cosx) for all real num-

bers x. T

n

is called the n-th Tchebychev Polynomial.

Problem 1.3.21 Prove that

1

n +1

+

1

n +2

+ +

1

2n

>

13

24

for all natural numbers n > 1.

Fibonacci Numbers 9

Problem 1.3.22 In how many regions will a sphere be divided

by n planes passing through its centre if no three planes pass

through one and the same diameter?

Problem 1.3.23 (IMO 1977) Let f , f : N →N be a function

satisfying

f (n +1) > f ( f (n))

for each positive integer n. Prove that f (n) = n for each n.

Problem 1.3.24 Let F

0

(x) = x, F(x) = 4x(1 −x), F

n+1

(x) =

F(F

n

(x)), n = 0, 1, . . . . Prove that

1

0

F

n

(x)dx =

2

2n−1

2

2n

−1

.

(Hint: Let x = sin

2

θ.)

1.4 Fibonacci Numbers

The Fibonacci numbers f

n

are given by the recurrence

f

0

= 0, f

1

= 1, f

n+1

= f

n−1

+ f

n

, n ≥1. (1.5)

Thus the ﬁrst few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, . . . . A number of interesting algebraic identities can be

proved using the above recursion.

16 Example Prove that

f

1

+ f

2

+ + f

n

= f

n+2

−1.

Solution: We have

f

1

= f

3

− f

2

f

2

= f

4

− f

3

f

3

= f

5

− f

4

.

.

.

.

.

.

f

n

= f

n+2

− f

n+1

Summing both columns,

f

1

+ f

2

+ + f

n

= f

n+2

− f

2

= f

n+2

−1,

as desired.

17 Example Prove that

f

1

+ f

3

+ f

5

+ + f

2n−1

= f

2n

.

Solution: Observe that

f

1

= f

2

− f

0

f

3

= f

4

− f

2

f

5

= f

6

− f

4

.

.

.

.

.

.

.

.

.

f

2n−1

= f

2n

− f

2n−2

Adding columnwise we obtain the desired identity.

18 Example Prove that

f

2

1

+ f

2

2

+ + f

2

n

= f

n

f

n+1

.

Solution: We have

f

n−1

f

n+1

= ( f

n+1

− f

n

)( f

n

+ f

n−1

) = f

n+1

f

n

− f

2

n

+ f

n+1

f

n−1

− f

n

f

n−1

.

Thus

f

n+1

f

n

− f

n

f

n−1

= f

2

n

,

10 Chapter 1

which yields

f

2

1

+ f

2

2

+ + f

2

n

= f

n

f

n+1

.

19 Theorem (Cassini’s Identity)

f

n−1

f

n+1

− f

2

n

= (−1)

n

, n ≥1.

Proof: Observe that

f

n−1

f

n+1

− f

2

n

= ( f

n

− f

n−2

)( f

n

+ f

n−1

) − f

2

n

= −f

n−2

f

n

− f

n−1

( f

n−2

− f

n

)

= −( f

n−2

f

n

− f

2

n−1

)

Thus if v

n

= f

n−1

f

n+1

− f

2

n

, we have v

n

= −v

n−1

. This yields v

n

= (−1)

n−1

v

1

which is to say

f

n−1

f

n+1

− f

2

n

= (−1)

n−1

( f

0

f

2

− f

2

1

) = (−1)

n

.

u

20 Example (IMO 1981) Determine the maximum value of

m

2

+n

2

,

where m, n are positive integers satisfying m, n ∈ ¦1, 2, 3, . . . , 1981¦ and

(n

2

−mn −m

2

)

2

= 1.

Solution: Call a pair (n, m) admissible if m, n ∈ ¦1, 2, . . . , 1981¦ and (n

2

−mn −m

2

)

2

= 1.

If m = 1, then (1, 1) and (2, 1) are the only admissible pairs. Suppose now that the pair (n

1

, n

2

) is admissible, with n

2

> 1.

As n

1

(n

1

−n

2

) = n

2

2

±1 > 0, we must have n

1

> n

2

.

Let now n

3

= n

1

−n

2

. Then 1 = (n

2

1

−n

1

n

2

−n

2

2

)

2

= (n

2

2

−n

2

n

3

−n

2

3

)

2

, making (n

2

, n

3

) also admissible. If n

3

> 1, in the

same way we conclude that n

2

> n

3

and we can let n

4

= n

2

−n

3

making (n

3

, n

4

) an admissible pair. We have a sequence of

positive integers n

1

> n

2

> . . ., which must necessarily terminate. This terminates when n

k

= 1 for some k. Since (n

k−1

, 1)

is admissible, we must have n

k−1

= 2. The sequence goes thus 1, 2, 3, 5, 8, . . . , 987, 1597, i.e., a truncated Fibonacci sequence.

The largest admissible pair is thus (1597, 987) and so the maximum sought is 1597

2

+987

2

.

Let τ =

1 +

√

5

2

be the Golden Ratio. Observe that τ

−1

=

√

5−1

2

. The number τ is a root of the quadratic equation

x

2

= x +1. We now obtain a closed formula for f

n

. We need the following lemma.

21 Lemma If x

2

= x +1, n ≥2 then we have x

n

= f

n

x + f

n−1

.

Proof: We prove this by induction on n. For n = 2 the assertion is a triviality. Assume that n > 2 and that

x

n−1

= f

n−1

x + f

n−2

. Then

x

n

= x

n−1

x

= ( f

n−1

x + f

n−2

)x

= f

n−1

(x +1) + f

n−2

x

= ( f

n−1

+ f

n−2

)x + f

n−1

= f

n

x + f

n−1

u

22 Theorem (Binet’s Formula) The n-th Fibonacci number is given by

f

n

=

1

√

5

ÇÇ

1 +

√

5

2

å

n

−

Ç

1 −

√

5

2

å

n

å

n = 0, 2, . . . .

Practice 11

Proof: The roots of the equation x

2

= x +1 are τ =

1 +

√

5

2

and 1 −τ =

1 −

√

5

2

. In virtue of the above lemma,

τ

n

= τ f

n

+ f

n−1

and

(1 −τ)

n

= (1 −τ) f

n

+ f

n−1

.

Subtracting

τ

n

− (1 −τ)

n

=

√

5 f

n

,

from where Binet’s Formula follows.u

23 Example (Cesàro) Prove that

n

¸

k=0

Ç

n

k

å

2

k

f

k

= f

3n

.

Solution: Using Binet’s Formula,

n

¸

k=0

Ç

n

k

å

2

k

f

k

=

n

¸

k=0

Ç

n

k

å

2

k

τ

k

− (1 −τ)

k

√

5

=

1

√

5

n

¸

k=0

Ç

n

k

å

τ

k

−

n

¸

k=0

Ç

n

k

å

2

k

(1 −τ)

k

=

1

√

5

((1 +2τ)

n

− (1 +2(1 −τ))

n

).

As τ

2

= τ +1, 1 +2τ = τ

3

. Similarly 1 +2(1 −τ) = (1 −τ)

3

. Thus

n

¸

k=0

Ç

n

k

å

2

k

f

k

=

1

√

5

Ä

(τ)

3n

+ (1 −τ)

3n

ä

= f

3n

,

as wanted.

The following theorem will be used later.

24 Theorem If s ≥1, t ≥0 are integers then

f

s+t

= f

s−1

f

t

+ f

s

f

t+1

.

Proof: We keep t ﬁxed and prove this by using strong induction on s. For s = 1 we are asking whether

f

t+1

= f

0

f

t

+ f

1

f

t+1

,

which is trivially true. Assume that s > 1 and that f

s−k+t

= f

s−k−1

f

t

+ f

s−k

f

t+1

for all k satisfying 1 ≤k ≤ s −1.

We have

f

s+t

= f

s+t−1

+ f

s+t−2

by the Fibonacci recursion,

= f

s−1+t

+ f

s−2+t

trivially,

= f

s−2

f

t

+ f

s−1

f

t+1

+ f

s−3

f

t

+ f

s−2

f

t+1

by the inductive assumption

= f

t

( f

s−2

+ f

s−3

) + f

t+1

( f

s−1

+ f

s−2

) rearranging,

= f

t

f

s−1

+ f

t+1

f

s

by the Fibonacci recursion.

This ﬁnishes the proof.u

Practice

12 Chapter 1

Problem 1.4.1 Prove that

f

n+1

f

n

− f

n−1

f

n−2

= f

2n−1

, n > 2.

Problem 1.4.2 Prove that

f

2

n+1

= 4 f

n

f

n−1

+ f

2

n−2

, n > 1.

Problem 1.4.3 Prove that

f

1

f

2

+ f

2

f

3

+ + f

2n−1

f

2n

= f

2

2n

.

Problem 1.4.4 Let N be a natural number. Prove that the

largest n such that f

n

≤N is given by

n =

log

Å

N +

1

2

ã

√

5

log

Ç

1 +

√

5

2

å .

Problem 1.4.5 Prove that f

2

n

+ f

2

n−1

= f

2n+1

.

Problem 1.4.6 Prove that if n > 1,

f

2

n

− f

n+l

f

n−l

= (−1)

n+l

f

2

l

.

Problem 1.4.7 Prove that

n

¸

k=1

f

2k

=

n

¸

k=0

(n −k) f

2k+1

.

Problem 1.4.8 Prove that

∞

¸

n=2

1

f

n−1

f

n+1

= 1.

Hint: What is

1

f

n−1

f

n

−

1

f

n

f

n+1

?

Problem 1.4.9 Prove that

∞

¸

n=1

f

n

f

n+1

f

n+2

= 1.

Problem 1.4.10 Prove that

∞

¸

n=0

1/ f

2

n = 4 −τ.

Problem 1.4.11 Prove that

∞

¸

n=1

arctan

1

f

2n+1

= π/4.

Problem 1.4.12 Prove that

lim

n→∞

f

n

τ

n

=

1

√

5

.

Problem 1.4.13 Prove that

lim

n→∞

f

n+r

f

n

= τ

r

.

Problem 1.4.14 Prove that

n

¸

k=0

1

f

2

k

= 2 +

f

2

n

−2

f

2

n

.

Deduce that

∞

¸

k=0

1

f

2

k

=

7 −

√

5

2

.

Problem 1.4.15 (Cesàro) Prove that

n

¸

k=0

Ç

n

k

å

f

k

= f

2n

.

Problem 1.4.16 Prove that

∞

¸

n=1

f

n

10

n

is a rational number.

Problem 1.4.17 Find the exact value of

1994

¸

k=1

(−1)

k

Ç

1995

k

å

f

k

.

Problem 1.4.18 Prove the converse of Cassini’s Identity: If k

and m are integers such that [m

2

−km−k

2

[ = 1, then there is

an integer n such that k =±f

n

, m =±f

n+1

.

Pigeonhole Principle 13

1.5 Pigeonhole Principle

The Pigeonhole Principle states that if n +1 pigeons ﬂy to n holes, there must be a pigeonhole containing at least two pigeons.

This apparently trivial principle is very powerful. Let us see some examples.

25 Example (Putnam 1978) Let A be any set of twenty integers chosen from the arithmetic progression 1, 4, . . . , 100. Prove

that there must be two distinct integers in A whose sum is 104.

Solution: We partition the thirty four elements of this progression into nineteen groups ¦1¦, ¦52¦, ¦4, 100¦ , ¦7, 97¦, ¦10, 94¦,

. . . ¦49, 55¦. Since we are choosing twenty integers and we have nineteen sets, by the Pigeonhole Principle there must be two

integers that belong to one of the pairs, which add to 104.

26 Example Show that amongst any seven distinct positive integers not exceeding 126, one can ﬁnd two of them, say a and b,

which satisfy

b < a ≤2b.

Solution: Split the numbers ¦1, 2, 3, . . . , 126¦ into the six sets

¦1, 2¦, ¦3, 4, 5, 6¦, ¦7, 8, . . ., 13, 14¦, ¦15, 16, . . ., 29, 30¦,

¦31, 32, . . . , 61, 62¦ and ¦63, 64, . . . , 126¦.

By the Pigeonhole Principle, two of the seven numbers must lie in one of the six sets, and obviously, any such two will satisfy

the stated inequality.

27 Example Given any set of ten natural numbers between 1 and 99 inclusive, prove that there are two disjoint nonempty

subsets of the set with equal sums of their elements.

Solution: There are 2

10

−1 = 1023 non-empty subsets that one can form with a given 10-element set. To each of these subsets

we associate the sum of its elements. The maximum value that any such sum can achieve is 90 +91 + +99 = 945 < 1023.

Therefore, there must be at least two different subsets that have the same sum.

28 Example No matter which ﬁfty ﬁve integers may be selected from

¦1, 2, . . . , 100¦,

prove that one must select some two that differ by 10.

Solution: First observe that if we choose n +1 integers from any string of 2n consecutive integers, there will always be some

two that differ by n. This is because we can pair the 2n consecutive integers

¦a +1, a +2, a +3, . . ., a +2n¦

into the n pairs

¦a +1, a +n +1¦, ¦a+2, a+n+2¦, . . ., ¦a +n, a +2n¦,

and if n +1 integers are chosen from this, there must be two that belong to the same group.

So now group the one hundred integers as follows:

¦1, 2, . . . 20¦, ¦21, 22, . . . , 40¦,

¦41, 42, . . . , 60¦, ¦61, 62, . . . , 80¦

and

¦81, 82, . . . , 100¦.

If we select ﬁfty ﬁve integers, we must perforce choose eleven from some group. From that group, by the above observation

(let n = 10), there must be two that differ by 10.

14 Chapter 1

29 Example (AHSME 1994) Label one disc “1”, two discs “2”, three discs “3”, . . . , ﬁfty discs ‘‘50”. Put these 1+2+3+ +

50 = 1275 labeled discs in a box. Discs are then drawn from the box at random without replacement. What is the minimum

number of discs that must me drawn in order to guarantee drawing at least ten discs with the same label?

Solution: If we draw all the 1 +2 + +9 = 45 labelled “1”, . . . , “9” and any nine from each of the discs “10”, . . . , “50”, we

have drawn 45 +9 41 = 414 discs. The 415-th disc drawn will assure at least ten discs from a label.

30 Example (IMO 1964) Seventeen people correspond by mail with one another—each one with all the rest. In their letters

only three different topics are discussed. Each pair of correspondents deals with only one of these topics. Prove that there at

least three people who write to each other about the same topic.

Solution: Choose a particular person of the group, say Charlie. He corresponds with sixteen others. By the Pigeonhole Principle,

Charlie must write to at least six of the people of one topic, say topic I. If any pair of these six people corresponds on topic I,

then Charlie and this pair do the trick, and we are done. Otherwise, these six correspond amongst themselves only on topics

II or III. Choose a particular person from this group of six, say Eric. By the Pigeonhole Principle, there must be three of the

ﬁve remaining that correspond with Eric in one of the topics, say topic II. If amongst these three there is a pair that corresponds

with each other on topic II, then Eric and this pair correspond on topic II, and we are done. Otherwise, these three people only

correspond with one another on topic III, and we are done again.

31 Example Given any seven distinct real numbers x

1

, . . . x

7

, prove that we can always ﬁnd two, say a, b with

0 <

a −b

1 +ab

<

1

√

3

.

Solution: Put x

k

= tana

k

for a

k

satisfying −

π

2

< a

k

<

π

2

. Divide the interval (−

π

2

,

π

2

) into six non-overlapping subintervals of

equal length. By the Pigeonhole Principle, two of seven points will lie on the same interval, say a

i

< a

j

. Then 0 < a

j

−a

i

<

π

6

.

Since the tangent increases in (−π/2, π/2), we obtain

0 < tan(a

j

−a

i

) =

tana

j

−tana

i

1 +tana

j

tana

i

< tan

π

6

=

1

√

3

,

as desired.

32 Example (Canadian Math Olympiad 1981) Let a

1

, a

2

, . . . , a

7

be nonnegative real numbers with

a

1

+a

2

+. . . +a

7

= 1.

If

M = max

1≤k≤5

a

k

+a

k+1

+a

k+2

,

determine the minimum possible value that M can take as the a

k

vary.

Solution: Since a

1

≤a

1

+a

2

≤a

1

+a

2

+a

3

and a

7

≤a

6

+a

7

≤a

5

+a

6

+a

7

we see that M also equals

max

1≤k≤5

¦a

1

, a

7

, a

1

+a

2

, a

6

+a

7

, a

k

+a

k+1

+a

k+2

¦.

We are thus taking the maximum over nine quantities that sum 3(a

1

+a

2

+ +a

7

) = 3. These nine quantities then average

3/9 = 1/3. By the Pigeonhole Principle, one of these is ≥ 1/3, i.e. M ≥1/3. If a

1

= a

1

+a

2

= a

1

+a

2

+a

3

= a

2

+a

3

+a

4

=

a

3

+a

4

+a

5

=a

4

+a

5

+a

6

=a

5

+a

6

+a

7

=a

7

=1/3, we obtain the 7-tuple (a

1

, a

2

, a

3

, a

4

, a

5

, a

6

, a

7

) = (1/3, 0, 0, 1/3, 0, 0, 1/3),

which shows that M = 1/3.

Practice

Practice 15

Problem 1.5.1 (AHSME 1991) A circular table has exactly

sixty chairs around it. There are N people seated at this table

in such a way that the next person to be seated must sit next to

someone. What is the smallest possible value of N?

Answer: 20.

Problem 1.5.2 Show that if any ﬁve points are all in, or on,

a square of side 1, then some pair of them will be at most at

distance

√

2/2.

Problem 1.5.3 (Eötvös, 1947) Prove that amongst six people

in a room there are at least three who know one another, or at

least three who do not know one another.

Problem 1.5.4 Show that in any sum of non-negative real

numbers there is always one number which is at least the av-

erage of the numbers and that there is always one member that

it is at most the average of the numbers.

Problem 1.5.5 We call a set “sum free” if no two elements of

the set add up to a third element of the set. What is the maxi-

mum size of a sum free subset of ¦1, 2, . . . , 2n −1¦.

Hint: Observe that the set ¦n+1, n+2, . . . , 2n−1¦ of n+1 el-

ements is sum free. Show that any subset with n +2 elements

is not sum free.

Problem 1.5.6 (MMPC 1992) Suppose that the letters of the

English alphabet are listed in an arbitrary order.

1. Prove that there must be four consecutive consonants.

2. Give a list to show that there need not be ﬁve consecu-

tive consonants.

3. Suppose that all the letters are arranged in a circle.

Prove that there must be ﬁve consecutive consonants.

Problem 1.5.7 (Stanford 1953) Bob has ten pockets and

forty four silver dollars. He wants to put his dollars into

his pockets so distributed that each pocket contains a differ-

ent number of dollars.

1. Can he do so?

2. Generalise the problem, considering p pockets and n

dollars. The problem is most interesting when

n =

(p −1)(p −2)

2

.

Why?

Problem 1.5.8 No matter which ﬁfty ﬁve integers may be se-

lected from

¦1, 2, . . . , 100¦,

prove that you must select some two that differ by 9, some two

that differ by 10, some two that differ by 12, and some two that

differ by 13, but that you need not have any two that differ by

11.

Problem 1.5.9 Let mn + 1 different real numbers be given.

Prove that there is either an increasing sequence with at least

n +1 members, or a decreasing sequence with at least m+1

members.

Problem 1.5.10 If the points of the plane are coloured with

three colours, show that there will always exist two points of

the same colour which are one unit apart.

Problem 1.5.11 Show that if the points of the plane are

coloured with two colours, there will always exist an equilat-

eral triangle with all its vertices of the same colour. There

is, however, a colouring of the points of the plane with two

colours for which no equilateral triangle of side 1 has all its

vertices of the same colour.

Problem 1.5.12 Let r

1

, r

2

, . . . , r

n

, n >1 be real numbers of ab-

solute value not exceeding 1 and whose sum is 0. Show that

there is a non-empty proper subset whose sum is not more than

2/n in size. Give an example in which any subsum has abso-

lute value at least

1

n −1

.

Problem 1.5.13 Let r

1

, r

2

, . . . , r

n

be real numbers in the in-

terval [0, 1]. Show that there are numbers ε

k

, 1 ≤ k ≤ n, ε

k

=

−1, 0, 1 not all zero, such that

n

¸

k=1

ε

k

r

k

≤

n

2

n

.

Problem 1.5.14 (USAMO, 1979) Nine mathematicians meet

at an international conference and discover that amongst any

three of them, at least two speak a common language. If

each of the mathematicians can speak at most three languages,

prove that there are at least three of the mathematicians who

can speak the same language.

Problem 1.5.15 (USAMO, 1982) In a party with 1982 per-

sons, amongst any group of four there is at least one person

who knows each of the other three. What is the minimum num-

ber of people in the party who know everyone else?

16 Chapter 1

Problem 1.5.16 (USAMO, 1985) There are n people at a

party. Prove that there are two people such that, of the re-

maining n −2 people, there are at least n/2−1 of them,

each of whom knows both or else knows neither of the two.

Assume that “knowing” is a symmetrical relationship.

Problem 1.5.17 (USAMO, 1986) During a certain lecture,

each of ﬁve mathematicians fell asleep exactly twice. For each

pair of these mathematicians, there was some moment when

both were sleeping simultaneously. Prove that, at some mo-

ment, some three were sleeping simultaneously.

Problem 1.5.18 Let P

n

be a set of en!+1 points on the

plane. Any two distinct points of P

n

are joined by a straight

line segment which is then coloured in one of n given colours.

Show that at least one monochromatic triangle is formed.

(Hint: e =

∞

¸

n=0

1/n!.)

Chapter 2

Divisibility

2.1 Divisibility

33 Deﬁnition If a = 0, b are integers, we say that a divides b if there is an integer c such that ac = b. We write this as a[b.

If a does not divide b we write a [b. The following properties should be immediate to the reader.

34 Theorem 1. If a, b, c, m, n are integers with c[a, c[b, then c[(am+nb).

2. If x, y, z are integers with x[y, y[z then x[z.

Proof: There are integers s, t with sc = a, tc = b. Thus

am+nb = c(sm+tn),

giving c[(am+bn).

Also, there are integers u, v with xu = y, yv = z. Hence xuv = z, giving x[z.

It should be clear that if a[b and b = 0 then 1 ≤[a[ ≤[b[.u

35 Example Find all positive integers n for which

n +1[n

2

+1.

Solution: n

2

+1 = n

2

−1 +2 = (n −1)(n +1) +2. This forces n +1[2 and so n +1 = 1 or n +1 = 2. The choice n +1 = 1 is

out since n ≥1, so that the only such n is n = 1.

36 Example If 7[3x +2 prove that 7[(15x

2

−11x −14.).

Solution: Observe that 15x

2

−11x −14 = (3x +2)(5x −7). We have 7s = 3x +2 for some integer s and so

15x

2

−11x −14 = 7s(5x −7),

giving the result.

Among every two consecutive integers there is an even one, among every three consecutive integers there is one divisible

by 3, etc.The following theorem goes further.

37 Theorem The product of n consecutive integers is divisible by n!.

17

18 Chapter 2

Proof: Assume ﬁrst that all the consecutive integers m+1, m+2, . . . , m+n are positive. If this is so, the divisibility

by n! follows from the fact that binomial coefﬁcients are integers:

Ç

m+n

n

å

=

(m+n)!

n!m!

=

(m+n)(m+n −1) (m+1)

n!

.

If one of the consecutive integers is 0, then the product of them is 0, and so there is nothing to prove. If all the n

consecutive integers are negative, we multiply by (−1)

n

, and see that the corresponding product is positive, and so

we apply the ﬁrst result.u

38 Example Prove that 6[n

3

−n, for all integers n.

Solution: n

3

−n = (n −1)n(n +1) is the product of 3 consecutive integers and hence is divisible by 3! = 6.

39 Example (Putnam 1966) Let 0 < a

1

< a

2

< . . . < a

mn+1

be mn +1 integers. Prove that you can ﬁnd either m+1 of them

no one of which divides any other, or n +1 of them, each dividing the following.

Solution: Let, for each 1 ≤k ≤mn+1, n

k

denote the length of the longest chain, starting with a

k

and each dividing the following

one, that can be selected from a

k

, a

k+1

, . . . , a

mn+1

. If no n

k

is greater than n, then the are at least m+1 n

k

’s that are the same.

However, the integers a

k

corresponding to these n

k

’s cannot divide each other, because a

k

[a

l

implies that n

k

≥n

l

+1.

40 Theorem If k[n then f

k

[ f

n

.

Proof: Letting s = kn, t = n in the identity f

s+t

= f

s−1

f

t

+ f

s

f

t+1

we obtain

f

(k+1)n

= f

kn+n

= f

n−1

f

kn

+ f

n

f

kn+1

.

It is clear that if f

n

[ f

kn

then f

n

[ f

(k+1)n

. Since f

n

[ f

n1

, the assertion follows.u

Practice

Problem 2.1.1 Given that 5[(n +2), which of the following

are divisible by 5

n

2

−4, n

2

+8n +7, n

4

−1, n

2

−2n?

Problem 2.1.2 Prove that n

5

−5n

3

+4n is always divisible by

120.

Problem 2.1.3 Prove that

(2m)!(3n)!

(m!)

2

(n!)

3

is always an integer.

Problem 2.1.4 Demonstrate that for all integer values n,

n

9

−6n

7

+9n

5

−4n

3

is divisible by 8640.

Problem 2.1.5 Prove that if n >4 is composite, then n divides

(n −1)!.

(Hint: Consider, separately, the cases when n is and is not a

perfect square.)

Problem 2.1.6 Prove that there is no prime triplet of the form

p, p +2, p +4, except for 3, 5, 7.

Problem 2.1.7 Prove that for n ∈ N, (n!)! is divisible by

n!

(n−1)!

Problem 2.1.8 (AIME 1986) What is the largest positive in-

teger n for which

(n +10)[(n

3

+100)?

(Hint: x

3

+y

3

= (x +y)(x

2

−xy +y

2

).)

Problem 2.1.9 (Olimpíada matemática española, 1985) If

n is a positive integer, prove that (n + 1)(n + 2) (2n) is

divisible by 2

n

.

Division Algorithm 19

2.2 Division Algorithm

41 Theorem (Division Algorithm) If a, b are positive integers, then there are unique integers q, r such that a =bq+r, 0 ≤r <b.

Proof: We use the Well-Ordering Principle. Consider the set S = ¦a −bk : k ∈ Z and a ≥ bk¦. Then S is a

collection of nonnegative integers and S = ∅ as a −b 0 ∈ S. By the Well-Ordering Principle, S has a least

element, say r. Now, there must be some q ∈ Z such that r = a −bq since r ∈ S. By construction, r ≥ 0. Let us

prove that r < b. For assume that r ≥ b. Then r > r −b = a −bq −b = a − (q +1)b ≥0, since r −b ≥0. But then

a− (q+1)b ∈ S and a− (q+1)b <r which contradicts the fact that r is the smallest member of S. Thus we must

have 0 ≤r < b. To show that r and q are unique, assume that bq

1

+r

1

= a = bq

2

+r

2

, 0 ≤r

1

< b, 0 ≤r

2

< b. Then

r

2

−r

1

= b(q

1

−q

2

), that is b[(r

2

−r

1

). But [r

2

−r

1

[ < b, whence r

2

= r

1

. From this it also follows that q

1

= q

2

.

This completes the proof. u

It is quite plain that q =a/b, where a/b denotes the integral part of a/b.

It is important to realise that given an integer n > 0, the Division Algorithm makes a partition of all the integers according

to their remainder upon division by n. For example, every integer lies in one of the families 3k, 3k +1 or 3k +2 where k ∈ Z.

Observe that the family 3k +2, k ∈ Z, is the same as the family 3k −1, k ∈ Z. Thus

Z = A∪B∪C

where

A =¦. . . , −9, −6, −3, 0, 3, 6, 9, . . .¦

is the family of integers of the form 3k, k ∈ Z,

B =¦. . . −8, −5, −2, 1, 4, 7, . . .¦

is the family of integers of the form 3k +1, k ∈ Z and

C = ¦. . . −7, −4, −1, 2, 5, 8, . . .¦

is the family of integers of the form 3k −1, k ∈ Z.

42 Example (AHSME 1976) Let r be the remainder when 1059, 1417 and 2312 are divided by d > 1. Find the value of d −r.

Solution: By the Division Algorithm, 1059 = q

1

d +r, 1417 = q

2

d +r, 2312 = q

3

d +r, for some integers q

1

, q

2

, q

3

. From this,

358 = 1417 −1059 = d(q

2

−q

1

), 1253 = 2312 −1059 = d(q

3

−q

1

) and 895 = 2312 −1417 = d(q

3

−q

2

). Hence d[358 =

2 179, d[1253 = 7 179 and 7[895 = 5 179. Since d > 1, we conclude that d = 179. Thus (for example) 1059 = 5 179+164,

which means that r = 164. We conclude that d −r = 179 −164 = 15.

43 Example Show that n

2

+23 is divisible by 24 for inﬁnitely many n.

Solution: n

2

+23 =n

2

−1+24 = (n−1)(n+1)+24. If we take n =24k±1, k =0, 1, 2, . . . , all these values make the expression

divisible by 24.

44 Deﬁnition A prime number p is a positive integer greater than 1 whose only positive divisors are 1 and p. If the integer

n > 1 is not prime, then we say that it is composite.

For example, 2, 3, 5, 7, 11, 13, 17, 19 are prime, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20 are composite. The number 1 is neither

a prime nor a composite.

45 Example Show that if p > 3 is a prime, then 24[(p

2

−1).

Solution: By the Division Algorithm, integers come in one of six ﬂavours: 6k, 6k ±1, 6k ±2 or 6k +3. If p > 3 is a prime, then

p is of the form p = 6k ±1 (the other choices are either divisible by 2 or 3). But (6k ±1)

2

−1 = 36k

2

±12k = 12k(3k −1).

Since either k or 3k −1 is even, 12k(3k −1) is divisible by 24.

20 Chapter 2

46 Example Prove that the square of any integer is of the form 4k or 4k +1.

Solution: By the Division Algorithm, any integer comes in one of two ﬂavours: 2a or 2a +1. Squaring,

(2a)

2

= 4a

2

, (2a +1)

2

= 4(a

2

+a) +1

and so the assertion follows.

47 Example Prove that no integer in the sequence

11, 111, 1111, 11111, . . .

is the square of an integer.

Solution: The square of any integer is of the form 4k or 4k +1. All the numbers in this sequence are of the form 4k −1, and so

they cannot be the square of any integer.

48 Example Show that from any three integers, one can always choose two so that a

3

b −ab

3

is divisible by 10.

Solution: It is clear that a

3

b −ab

3

= ab(a −b)(a +b) is always even, no matter which integers are substituted. If one of the

three integers is of the form 5k, then we are done. If not, we are choosing three integers that lie in the residue classes 5k ±1 or

5k ±2. Two of them must lie in one of these two groups, and so there must be two whose sum or whose difference is divisible

by 5. The assertion follows.

49 Example Prove that if 3[(a

2

+b

2

), then 3[a and 3[b

Solution: Assume a = 3k ±1 or b = 3m±1. Then a

2

= 3x +1, b

2

= 3y +1. But then a

2

+b

2

= 3t +1 or a

2

+b

2

= 3s +2, i.e.,

3 [(a

2

+b

2

).

Practice

Problem 2.2.1 Prove the following extension of the Division

Algorithm: if a and b = 0 are integers, then there are unique

integers q and r such that a = qb +r, 0 ≤r <[b[.

Problem 2.2.2 Show that if a and b are positive integers,

then there are unique integers q and r, and ε = ±1 such that

a = qb +εr, −

b

2

< r ≤

b

2

.

Problem 2.2.3 Show that the product of two numbers of the

form 4k +3 is of the form 4k +1.

Problem 2.2.4 Prove that the square of any odd integer leaves

remainder 1 upon division by 8.

Problem 2.2.5 Demonstrate that there are no three consec-

utive odd integers such that each is the sum of two squares

greater than zero.

Problem 2.2.6 Let n > 1 be a positive integer. Prove that if

one of the numbers 2

n

−1, 2

n

+1 is prime, then the other is

composite.

Problem 2.2.7 Prove that there are inﬁnitely many integers n

such that 4n

2

+1 is divisible by both 13 and 5.

Problem 2.2.8 Prove that any integer n >11 is the sum of two

positive composite numbers.

Hint: Think of n −6 if n is even and n −9 if n is odd.

Problem 2.2.9 Prove that 3 never divides n

2

+1.

Problem 2.2.10 Show the existence of inﬁnitely many natural

numbers x, y such that x(x +1)[y(y +1) but

x [y and (x +1) [y,

and also

x [(y +1) and (x +1) [(y +1).

Hint: Try x = 36k +14, y = (12k +5)(18k +7).

Some Algebraic Identities 21

2.3 Some Algebraic Identities

In this section we present some examples whose solutions depend on the use of some elementary algebraic identities.

50 Example Find all the primes of the form n

3

−1, for integer n > 1.

Solution: n

3

−1 = (n −1)(n

2

+n +1). If the expression were prime, since n

2

+n +1 is always greater than 1, we must have

n −1 = 1, i.e. n = 2. Thus the only such prime is 7.

51 Example Prove that n

4

+4 is a prime only when n = 1 for n ∈ N.

Solution: Observe that

n

4

+4 = n

4

+4n

2

+4 −4n

2

= (n

2

+2)

2

− (2n)

2

= (n

2

+2 −2n)(n

2

+2 +2n)

= ((n −1)

2

+1)((n +1)

2

+1).

Each factor is greater than 1 for n > 1, and so n

4

+4 cannot be a prime.

52 Example Find all integers n ≥1 for which n

4

+4

n

is a prime.

Solution: The expression is only prime for n =1. Clearly one must take n odd. For n ≥3 odd all the numbers below are integers:

n

4

+2

2n

= n

4

+2n

2

2

n

+2

2n

−2n

2

2

n

= (n

2

+2

n

)

2

−

Ä

n2

(n+1)/2

ä

2

= (n

2

+2

n

+n2

(n+1)/2

)(n

2

+2

n

−n2

(n+1)/2

).

It is easy to see that if n ≥3, each factor is greater than 1, so this number cannot be a prime.

53 Example Prove that for all n ∈ N , n

2

divides the quantity

(n +1)

n

−1.

Solution: If n = 1 this is quite evident. Assume n > 1. By the Binomial Theorem,

(n +1)

n

−1 =

n

¸

k=1

Ç

n

k

å

n

k

,

and every term is divisible by n

2

.

54 Example Prove that if p is an odd prime and if

a

b

= 1 +1/2 + +1/(p −1),

then p divides a.

Solution: Arrange the sum as

1 +

1

p −1

+

1

2

+

1

p −2

+ +

1

(p −1)/2

+

1

(p +1)/2

.

After summing consecutive pairs, the numerator of the resulting fractions is p. Each term in the denominator is < p. Since p is

a prime, the p on the numerator will not be thus cancelled out.

22 Chapter 2

55 Example Prove that

x

n

−y

n

= (x −y)(x

n−1

+x

n−2

y +x

n−3

y

2

+ +xy

n−2

+y

n−1

)

Thus x −y always divides x

n

−y

n

.

Solution: We may assume that x = y, xy = 0, the result being otherwise trivial. In that case, the result follows at once from the

identity

n−1

¸

k=0

a

k

=

a

n

−1

a −1

a = 1,

upon letting a = x/y and multiplying through by y

n

.

Without calculation we see that 8767

2345

−8101

2345

is divisible by 666.

56 Example (E˝ otv˝ os 1899) Show that

2903

n

−803

n

−464

n

+261

n

is divisible by 1897 for all natural numbers n.

Solution: By the preceding problem, 2903

n

−803

n

is divisible by 2903 −803 = 2100 = 7 300 =, and 261

n

−464

n

is divisible

by 261 −464 = −203 = 7 (−29). Thus the expression 2903

n

−803

n

−464

n

+261

n

is divisible by 7. Also, 2903

n

−464

n

is

divisible by 2903 −464 = 9 271 and 261

n

−803

n

is divisible by −542 = (−2)271. Thus the expression is also divisible by

271. Since 7 and 271 have no prime factors in common, we can conclude that the expression is divisible by 7 271 = 1897.

57 Example ((UM)

2

C

4

1987) Given that 1002004008016032 has a prime factor p > 250000, ﬁnd it.

Solution: If a = 10

3

, b = 2 then

1002004008016032 = a

5

+a

4

b +a

3

b

2

+a

2

b

3

+ab

4

+b

5

=

a

6

−b

6

a −b

.

This last expression factorises as

a

6

−b

6

a −b

= (a +b)(a

2

+ab +b

2

)(a

2

−ab +b

2

)

= 1002 1002004 998004

= 4 4 1002 250501 k,

where k < 250000. Therefore p = 250501.

58 Example (Grünert, 1856) If x, y, z, n are natural numbers n ≥z, then the relation

x

n

+y

n

= z

n

does not hold.

Solution: It is clear that if the relation x

n

+y

n

= z

n

holds for natural numbers x, y, z then x < z and y < z. By symmetry, we may

suppose that x < y. So assume that x

n

+y

n

= z

n

and n ≥z. Then

z

n

−y

n

= (z −y)(z

n−1

+yz

n−2

+ +y

n−1

) ≥1 nx

n−1

> x

n

,

contrary to the assertion that x

n

+y

n

= z

n

. This establishes the assertion.

Practice 23

59 Example Prove that for n odd,

x

n

+y

n

= (x +y)(x

n−1

−x

n−2

y +x

n−3

y

2

− + − + −xy

n−2

+y

n−1

).

Thus if n is odd, x +y divides x

n

+y

n

.

Solution: This is evident by substituting −y for y in example 1.11 and observing that (−y)

n

= −y

n

for n odd.

60 Example Show that 1001 divides

1

1993

+2

1993

+3

1993

+ +1000

1993

.

Solution: Follows at once from the previous problem, since each of 1

1993

+1000

1993

, 2

1993

+999

1993

, . . . , 500

1993

+501

1993

is

divisible by 1001.

61 Example (S250) Show that for any natural number n, there is another natural number x such that each term of the sequence

x +1, x

x

+1, x

x

x

+1, . . .

is divisible by n.

Solution: It sufﬁces to take x = 2n −1.

62 Example Determine inﬁnitely many pairs of integers (m, n) such that M and n share their prime factors and (m−1, n −1)

share their prime factors.

Solution: Take m = 2

k

−1, n = (2

k

−1)

2

, k = 2, 3, . . .. Then m, n obviously share their prime factors and m−1 = 2(2

k−1

−1)

shares its prime factors with n −1 = 2

k+1

(2

k−1

−1).

Practice

Problem 2.3.1 Show that the integer

1. . . 1

. .. .

91 ones

is composite.

Problem 2.3.2 Prove that 1

99

+2

99

+3

99

+4

99

is divisible by

5.

Problem 2.3.3 Show that if [ab[ =1, then a

4

+4b

4

is compos-

ite.

Problem 2.3.4 Demonstrate that for any natural number n,

the number

1 1

. .. .

2n 1

′

s

−2 2

. .. .

n 2

′

s

is the square of an integer.

Problem 2.3.5 Let 0 ≤a < b.

1. Prove that b

n

((n +1)a −nb) < a

n+1

.

2. Prove that for n = 1, 2, . . .,

Å

1 +

1

n

ã

n

<

Å

1 +

1

n +1

ã

n+1

n = 1, 2, . . . .

3. Show that

b

n+1

−a

n+1

b −a

> (n +1)a.

4. Show that

Å

1 +

1

n

ã

n+1

>

Å

1 +

1

n +1

ã

n+2

n = 1, 2, . . . .

Problem 2.3.6 If a, b are positive integers, prove that

(a +1/2)

n

+ (b +1/2)

n

is an integer only for ﬁnitely many positive integers n.

Problem 2.3.7 Prove that 100[11

10

−1.

24 Chapter 2

Problem 2.3.8 Let A and B be two natural numbers with the

same number of digits, A>B. Suppose that A and B have more

than half of their digits on the sinistral side in common. Prove

that

A

1/n

−B

1/n

<

1

n

for all n = 2, 3, 4, . . ..

Problem 2.3.9 Demonstrate that every number in the se-

quence

49, 4489, 444889, 44448889, . . ., 4 4

. .. .

n 4

′

s

8 8

. .. .

n−1 8

′

s

9,

is the square of an integer.

Problem 2.3.10 (Polish Mathematical Olympiad) Prove

that if n is an even natural number, then the number 13

n

+6 is

divisible by 7.

Problem 2.3.11 Find, with proof, the unique square which is

the product of four consecutive odd numbers.

Problem 2.3.12 Prove that the number 2222

5555

+5555

2222

is

divisible by 7.

(Hint: Consider

2222

5555

+4

5555

+5555

2222

−4

2222

+4

2222

−4

5555

.)

Problem 2.3.13 Prove that if a

n

+1, 1 < a ∈ N, is prime, then

a is even and n is a power of 2. Primes of the form 2

2

k

+1 are

called Fermat primes.

Problem 2.3.14 Prove that if a

n

−1, 1 < a ∈ N, is prime, then

a = 2 and n is a prime. Primes of the form 2

n

−1 are called

Mersenne primes.

Problem 2.3.15 (Putnam, 1989) How many primes amongst

the positive integers, written as usual in base-ten are such that

their digits are alternating 1’s and 0’s, beginning and ending

in 1?

Problem 2.3.16 Find the least value achieved by 36

k

−5

k

, k =

1, 2, . . . .

Problem 2.3.17 Find all the primes of the form n

3

+1.

Problem 2.3.18 Find a closed formula for the product

P = (1 +2)(1 +2

2

)(1 +2

2

2

) (1 +2

2

n

).

Use this to prove that for all positive integers n, 2

2

n

+1 divides

2

2

2

n

+1

−2.

Problem 2.3.19 Let a > 1 be a real number. Simplify the ex-

pression

»

a +2

√

a −1+

»

a −2

√

a −1.

Problem 2.3.20 Let a, b, c, d be real numbers such that

a

2

+b

2

+c

2

+d

2

= ab +bc +cd+da.

Prove that a = b = c = d.

Problem 2.3.21 Let a, b, c be the lengths of the sides of a tri-

angle. Show that

3(ab +bc +ca) ≤(a +b +c)

2

≤4(ab +bc +ca).

Problem 2.3.22 (ITT, 1994) Let a, b, c, d be complex num-

bers satisfying

a +b +c +d = a

3

+b

3

+c

3

+d

3

= 0.

Prove that a pair of the a, b, c, d must add up to 0.

Problem 2.3.23 Prove that the product of four consecutive

natural numbers is never a perfect square.

Hint: What is (n

2

+n −1)

2

?

Problem 2.3.24 Let k ≥ 2 be an integer. Show that if n is a

positive integer, then n

k

can be represented as the sum of n

successive odd numbers.

Problem 2.3.25 (Catalan) Prove that

1 −

1

2

+

1

3

−

1

4

+ +

1

2n −1

−

1

2n

equals

1

n +1

+

1

n +2

+ +

1

2n

.

Problem 2.3.26 (IMO, 1979) If a, b are natural numbers

such that

a

b

= 1 −

1

2

+

1

3

−

1

4

+ −

1

1318

+

1

1319

,

prove that 1979[a.

Practice 25

Problem 2.3.27 (Polish Mathematical Olympiad) A trian-

gular number is one of the form 1 +2 +. . . +n, n ∈ N. Prove

that none of the digits 2, 4, 7, 9 can be the last digit of a trian-

gular number.

Problem 2.3.28 Demonstrate that there are inﬁnitely many

square triangular numbers.

Problem 2.3.29 (Putnam, 1975) Supposing that an integer n

is the sum of two triangular numbers,

n =

a

2

+a

2

+

b

2

+b

2

,

write 4n+1 as the sum of two squares, 4n+1 = x

2

+y

2

where

x and y are expressed in terms of a and b.

Conversely, show that if 4n+1 = x

2

+y

2

, then n is the sum

of two triangular numbers.

Problem 2.3.30 (Polish Mathematical Olympiad) Prove

that amongst ten successive natural numbers, there are always

at least one and at most four numbers that are not divisible by

any of the numbers 2, 3, 5, 7.

Problem 2.3.31 Show that if k is odd,

1 +2 + +n

divides

1

k

+2

k

+ +n

k

.

Problem 2.3.32 Are there ﬁve consecutive positive integers

such that the sum of the ﬁrst four, each raised to the fourth

power, equals the ﬁfth raised to the fourth power?

Chapter 3

Congruences. Z

n

3.1 Congruences

The notation a ≡ b mod n is due to Gauß, and it means that n[(a −b). It also indicates that a and b leave the same remainder

upon division by n. For example, −8 ≡ −1 ≡ 6 ≡ 13 mod 7. Since n[(a −b) implies that ∃k ∈ Z such that nk = a −b, we

deduce that a ≡b mod n if and only if there is an integer k such that a = b +nk.

We start by mentioning some simple properties of congruences.

63 Lemma Let a, b, c, d, m∈ Z, k ∈ with a ≡b mod m and c ≡d mod m. Then

1. a +c ≡b +d mod m

2. a −c ≡b −d mod m

3. ac ≡bd mod m

4. a

k

≡b

k

mod m

5. If f is a polynomial with integral coefﬁcients then f (a) ≡ f (b) mod m.

Proof: As a ≡ b mod m and c ≡ d mod m, we can ﬁnd k

1

, k

2

∈ Z with a = b +k

1

m and c = d +k

2

m. Thus

a±c = b±d +m(k

1

±k

2

) and ac = bd +m(k

2

b+k

1

d). These equalities give (1), (2) and (3). Property (4) follows

by successive application of (3), and (5) follows from (4). u

Congruences mod 9 can sometimes be used to check multiplications. For example 875961 2753 = 2410520633. For if

this were true then

(8 +7 +5 +9 +6+1)(2 +7+5+3) ≡2 +4 +1 +0 +5+2+0+6+3+3 mod 9.

But this says that 0 8 ≡8 mod 9, which is patently false.

64 Example Find the remainder when 6

1987

is divided by 37.

Solution: 6

2

≡−1 mod 37. Thus 6

1987

≡6 6

1986

≡6(6

2

)

993

≡6(−1)

993

≡−6 ≡31 mod 37.

65 Example Prove that 7 divides 3

2n+1

+2

n+2

for all natural numbers n.

Solution: Observe that 3

2n+1

≡3 9

n

≡3 2

n

mod 7 and 2

n+2

≡4 2

n

mod 7. Hence

3

2n+1

+2

n+2

≡7 2

n

≡0 mod 7,

for all natural numbers n.

26

Congruences 27

66 Example Prove the following result of Euler: 641[(2

32

+1).

Solution: Observe that 641 = 2

7

5 +1 = 2

4

+5

4

. Hence 2

7

5 ≡ −1 mod 641 and 5

4

≡ −2

4

mod 641. Now, 2

7

5 ≡ −1

mod 641 yields 5

4

2

28

= (5 2

7

)

4

≡ (−1)

4

≡ 1 mod 641. This last congruence and 5

4

≡ −2

4

mod 641 yield −2

4

2

28

≡ 1

mod 641, which means that 641[(2

32

+1).

67 Example Find the perfect squares mod 13.

Solution: First observe that we only have to square all the numbers up to 6, because r

2

≡ (13 −r)

2

mod 13. Squaring the

nonnegative integers up to 6, we obtain 0

2

≡0, 1

2

≡1, 2

2

≡ 4, 3

2

≡9, 4

2

≡3, 5

2

≡ 12, 6

2

≡ 10 mod 13. Therefore the perfect

squares mod 13 are 0, 1, 4, 9, 3, 12, and 10.

68 Example Prove that there are no integers with x

2

−5y

2

= 2.

Solution: If x

2

= 2 −5y

2

, then x

2

≡2 mod 5. But 2 is not a perfect square mod 5.

69 Example Prove that 7[(2222

5555

+5555

2222

).

Solution: 2222 ≡ 3 mod 7, 5555 ≡ 4 mod 7 and 3

5

≡ 5 mod 7. Now 2222

5555

+5555

2222

≡ 3

5555

+4

2222

≡ (3

5

)

1111

+

(4

2

)

1111

≡5

1111

−5

1111

≡0 mod 7.

70 Example Find the units digit of 7

7

7

.

Solution: We must ﬁnd 7

7

7

mod 10. Now, 7

2

≡ −1 mod 10, and so 7

3

≡ 7

2

7 ≡ −7 ≡ 3 mod 10 and 7

4

≡ (7

2

)

2

≡ 1

mod 10. Also, 7

2

≡ 1 mod 4 and so 7

7

≡ (7

2

)

3

7 ≡ 3 mod 4, which means that there is an integer t such that 7

7

= 3 +4t.

Upon assembling all this,

7

7

7

≡7

4t+3

≡(7

4

)

t

7

3

≡1

t

3 ≡3 mod 10.

Thus the last digit is 3.

71 Example Prove that every year, including any leap year, has at least one Friday 13-th.

Solution: It is enough to prove that each year has a Sunday the 1st. Now, the ﬁrst day of a month in each year falls in one of the

following days:

Month Day of the year mod 7

January 1 1

February 32 4

March 60 or 61 4 or 5

April 91 or 92 0 or 1

May 121 or122 2 or 3

June 152 or 153 5 or 6

July 182 or183 0 or 1

August 213 or 214 3 or 4

September 244 or 245 6 or 0

October 274 or 275 1 or 2

November 305 or 306 4 or 5

December 335 or 336 6 or 0

(The above table means that, depending on whether the year is a leap year or not, that March 1st is the 50th or 51st day of the

year, etc.) Now, each remainder class modulo 7 is represented in the third column, thus each year, whether leap or not, has at

least one Sunday the 1st.

28 Chapter 3

72 Example Find inﬁnitely many integers n such that 2

n

+27 is divisible by 7.

Solution: Observe that 2

1

≡ 2, 2

2

≡ 4, 2

3

≡ 1, 2

4

≡ 2, 2

5

≡ 4, 2

6

≡ 1 mod 7 and so 2

3k

≡ 1 mod 3 for all positive integers k.

Hence 2

3k

+27 ≡1 +27 ≡0 mod 7 for all positive integers k. This produces the inﬁnitely many values sought.

73 Example Are there positive integers x, y such that x

3

= 2

y

+15?

Solution: No. The perfect cubes mod 7 are 0, 1, and 6. Now, every power of 2 is congruent to 1, 2, or 4 mod 7. Thus

2

y

+15 ≡2, 3, or 5 mod 7. This is an impossibility.

74 Example Prove that 2

k

−5, k = 0, 1, 2, . . . never leaves remainder 1 when divided by 7.

Solution: 2

1

≡2, 2

2

≡4, 2

3

≡ 1 mod 7, and this cycle of three repeats. Thus 2

k

−5 can leave only remainders 3, 4, or 6 upon

division by 7.

75 Example (AIME, 1994) The increasing sequence

3, 15, 24, 48, . . . ,

consists of those positive multiples of 3 that are one less than a perfect square. What is the remainder when the 1994-th term of

the sequence is divided by 1000?

Solution: We want 3[n

2

−1 = (n −1)(n +1). Since 3 is prime, this requires n = 3k +1 or n = 3k −1, k = 1, 2, 3, . . .. The

sequence 3k +1, k = 1, 2, . . . produces the terms n

2

−1 = (3k +1)

2

−1 which are the terms at even places of the sequence of

3, 15, 24, 48, . . .. The sequence 3k −1, k = 1, 2, . . . produces the terms n

2

−1 = (3k −1)

2

−1 which are the terms at odd places

of the sequence 3, 15, 24, 48, . . .. We must ﬁnd the 997th term of the sequence 3k +1, k = 1, 2, . . .. Finally, the term sought is

(3(997) +1)

2

−1 ≡(3(−3) +1)

2

−1 ≡8

2

−1 ≡63 mod 1000. The remainder sought is 63.

76 Example (USAMO, 1979) Determine all nonnegative integral solutions

(n

1

, n

2

, . . . , n

14

)

if any, apart from permutations, of the Diophantine equation

n

4

1

+n

4

2

+ +n

4

14

= 1599.

Solution: There are no such solutions. All perfect fourth powers mod 16 are ≡0 or 1 mod 16. This means that

n

4

1

+ +n

4

14

can be at most 14 mod 16. But 1599 ≡15 mod 16.

77 Example (Putnam, 1986) What is the units digit of

10

20000

10

100

+3

?

Solution: Set a−3 =10

100

. Then [(10

20000

)/10

100

+3] = [(a−3)

200

/a] = [

1

a

200

¸

k=0

Ç

200

k

å

a

200−k

(−3)

k

] =

199

¸

k=0

Ç

200

k

å

a

199−k

(−3)

k

.

Since

200

¸

k=0

(−1)

k

Ç

200

k

å

= 0, (3)

199

199

¸

k=0

(−1)

k

Ç

200

k

å

= −3

199

. As a ≡3 mod 10,

199

¸

k=0

Ç

200

k

å

a

199−k

(−3)

k

≡3

199

199

¸

k=0

(−1)

k

Ç

200

k

å

≡−3

199

≡3 mod 10.

Congruences 29

78 Example Prove that for any a, b, c ∈ Z, n ∈ N, n > 3, there is an integer k such that n [(k +a), n [(k +b), n [(k +c).

Solution: The integers a, b, c belong to at most three different residue classes mod n. Since n > 3, we have more than three

distinct residue classes. Thus there must be a residue class, say k for which −k ≡ a, −k ≡ b, −k ≡ c, mod n. This solves the

problem.

79 Example (Putnam, 1973) Let a

1

, a

2

, . . . , a

2n+1

be a set of integers such that if any one of them is removed, the remaining

ones can be divided into two sets of n integers with equal sums. Prove that a

1

= a

2

= . . . = a

2n+1

.

Solution: As the sum of the 2n integers remaining is always even, no matter which of the a

k

be taken, all the a

k

must have the

same parity. The property stated in the problem is now shared by a

k

/2 or (a

k

−1)/2, depending on whether they are all even, or

all odd. Thus they are all congruent mod 4. Continuing in this manner we arrive at the conclusion that the a

k

are all congruent

mod 2

k

for every k, and this may only happen if they are all equal.

80 Example Prove that

(kn)! ≡0 mod

n−1

¸

r=0

(n +r)

if n, k ∈ N, n ≥k ≥2.

Solution: (kn)! = M(n −1)!n(n +1) (2n −1) for some integer M ≥1. The assertion follows.

81 Example Let

n!! = n! (1/2! −1/3! + + (−1)

n

/n!).

Prove that for all n ∈ N, n > 3,

n!! ≡n! mod (n −1).

Solution: We have

n! −n!! = n(n −1)(n −2)!(1 −1/2!

+ + (−1)

n−1

/(n −1)! + (−1)

n

/n!)

= (n −1)

Ä

m+ (−1)

n−1

n/(n −1) + (−1)

n

/(n −1)

ä

= (n −1)(m+ (−1)

n

) ,

where M is an integer, since (n −2)! is divisible by k!, k ≤n −2.

82 Example Prove that

6n+2

¸

k=0

Ç

6n +2

2k

å

3

k

≡0, 2

3n+1

, −2

3n+1

mod 2

3n+2

when n is of the form 2k, 4k +3 or 4k +1 respectively.

Solution: Using the Binomial Theorem,

2S := 2

3n+1

¸

k=0

Ç

6n +2

2k

å

3

k

= (1 +

√

3)

6n+2

+ (1 −

√

3)

6n+2

.

Also, if n is odd, with a = 2 +

√

3, b = 2 −

√

3,

1

2

(a

3n+1

+b

3n+1

) =

3n +1

2

¸

r=0

Ç

3n +1

2r

å

2

3n+1−2r

3

r

.

≡ 3

(3n+1)/2

mod 4

≡ (−1)

(n−1)/2

mod 4.

30 Chapter 3

As 2S = 2

3n+1

(a

3n+1

+b

3n+1

), we have, for odd n,

S ≡(−1)

(n−1)/2

2

3n+1

mod 2

3n+3

.

If n is even,

1

2

(a

3n+1

+b

3n+1

) =

¸

2r≤3n

Ç

3n +1

2r +1

å

2

2r+1

3

3n−2r

≡ 2(6n +1)3

3n

mod 8

≡ 4n +2 mod 8.

So for even n, S ≡2

3n+2

2n +1 mod 2

3n+4

.

Practice

Problem 3.1.1 Find the number of all n, 1 ≤n ≤25 such that

n

2

+15n +122 is divisible by 6.

(Hint: n

2

+15n+122 ≡n

2

+3n+2 = (n+1)(n+2) mod 6.)

Problem 3.1.2 (AIME 1983) Let a

n

=6

n

+8

n

. Determine the

remainder when a

83

is divided by 49.

Problem 3.1.3 (POLISH MATHEMATICAL OLYMPIAD)

What digits should be put instead of x and y in 30x0y03 in

order to give a number divisible by 13?

Problem 3.1.4 Prove that if 9[(a

3

+b

3

+c

3

), then 3[abc, for

integers a, b, c.

Problem 3.1.5 Describe all integers n such that 10[n

10

+1.

Problem 3.1.6 Prove that if

a −b, a

2

−b

2

, a

3

−b

3

, a

4

−b

4

, . . .

are all integers, then a and b must also be integers.

Problem 3.1.7 Find the last digit of 3

100

.

Problem 3.1.8 (AHSME 1992) What is the size of the largest

subset S of ¦1, 2, . . . , 50¦ such that no pair of distinct elements

of S has a sum divisible by 7?

Problem 3.1.9 Prove that there are no integer solutions to the

equation x

2

−7y = 3.

Problem 3.1.10 Prove that if 7[a

2

+b

2

then 7[a and 7[b.

Problem 3.1.11 Prove that there are no integers with

800000007 = x

2

+y

2

+z

2

.

Problem 3.1.12 Prove that the sum of the decimal digits of a

perfect square cannot be equal to 1991.

Problem 3.1.13 Prove that

7[4

2

n

+2

2

n

+1

for all natural numbers n.

Problem 3.1.14 Prove that 5 never divides

n

¸

k=0

2

3k

Ç

2n +1

2k +1

å

.

Problem 3.1.15 Prove that if p is a prime,

Ç

n

p

å

− [

n

p

] is di-

visible by p, for all n ≥ p.

Problem 3.1.16 How many perfect squares are there

mod 2

n

?

Problem 3.1.17 Prove that every non-multiple of 3 is a per-

fect power of 2 mod 3

n

.

Problem 3.1.18 Find the last two digits of 3

100

.

Problem 3.1.19 (USAMO, 1986) What is the smallest inte-

ger n >1, for which the root-mean-square of the ﬁrst n positive

integers is an integer?

Note. The root mean square of n numbers a

1

, a

2

, . . . , a

n

is deﬁned to be

Å

a

2

1

+a

2

2

+ +a

2

n

n

ã

1/2

.

Divisibility Tests 31

Problem 3.1.20 Find all integers a, b, c, a > 1 and all prime

numbers p, q, r which satisfy the equation

p

a

= q

b

+r

c

(a, b, c, p, q, r need not necessarily be different).

Problem 3.1.21 Show that the number 16 is a perfect 8-th

power mod p for any prime p.

Problem 3.1.22 (IMO, 1975) Let a

1

, a

2

, a

3

, . . . be an increas-

ing sequence of positive integers. Prove that for every s ≥ 1

there are inﬁnitely many a

m

that can be written in the form

a

m

= xa

s

+ya

t

with positive integers x and y and t > s.

Problem 3.1.23 For each integer n > 1, prove that n

n

−n

2

+

n −1 is divisible by (n −1)

2

.

Problem 3.1.24 Let x and a

i

, i = 0, 1, . . . , k be arbitrary inte-

gers. Prove that

k

¸

i=0

a

i

(x

2

+1)

3i

is divisible by x

2

±x +1 if and only if

k

¸

i=0

(−1)

i

a

i

is divisible

by x

2

±x +1.

Problem 3.1.25 ((UM)

2

C

9

1992) If x, y, z are positive inte-

gers with

x

n

+y

n

= z

n

for an odd integer n ≥3, prove that z cannot be a prime-power.

3.2 Divisibility Tests

Working base-ten, we have an ample number of rules of divisibility. The most famous one is perhaps the following.

83 Theorem (Casting-out 9’s) A natural number n is divisible by 9 if and only if the sum of it digits is divisible by 9.

Proof: Let n = a

k

10

k

+a

k−1

10

k−1

+ +a

1

10 +a

0

be the base-10 expansion of n. As 10 ≡ 1 mod 9, we have

10

j

≡1 mod 9. It follows that n = a

k

10

k

+ +a

1

10 +a

0

≡a

k

+ +a

1

+a

0

, whence the theorem. u

84 Example (AHSME, 1992) The two-digit integers from 19 to 92 are written consecutively in order to form the integer

192021222324 89909192.

What is the largest power of 3 that divides this number?

Solution: By the casting-out-nines rule, this number is divisible by 9 if and only if

19 +20 +21 + +92 = 37

2

3

is. Therefore, the number is divisible by 3 but not by 9.

85 Example (IMO, 1975) When 4444

4444

is written in decimal notation, the sum of its digits is A. Let B be the sum of the

digits of A. Find the sum of the digits of B. (A and B are written in decimal notation.)

Solution: We have 4444 ≡7 mod 9, and hence 4444

3

≡7

3

≡1 mod 9. Thus 4444

4444

=4444

3(1481)

4444 ≡1 7 ≡7 mod 9.

Let C be the sum of the digits of B.

By the casting-out 9’s rule, 7 ≡4444

4444

≡A ≡B ≡C mod 9. Now, 4444log

10

4444 <4444log

10

10

4

=17776. This means

that 4444

4444

has at most 17776 digits, so the sum of the digits of 4444

4444

is at most 9 17776 = 159984, whence A ≤159984.

Amongst all natural numbers ≤ 159984 the one with maximal digit sum is 99999, so it follows that B ≤ 45. Of all the natural

numbers ≤45, 39 has the largest digital sum, namely 12. Thus the sum of the digits of B is at most 12. But since C ≡7 mod 9,

it follows that C = 7.

A criterion for divisibility by 11 can be established similarly. For let n = a

k

10

k

+a

k−1

10

k−1

+ +a

1

10+a

0

. As 10 ≡−1

mod 11, we have 10

j

≡(−1)

j

mod 11. Therefore n ≡(−1)

k

a

k

+(−1)

k−1

a

k−1

+ −a

1

+a

0

mod 11, that is, n is divisible by

11 if and only if the alternating sumof its digits is divisible by 11. For example, 912282219≡9−1+2−2+8−2+2−1+9 ≡7

mod 11 and so 912282219 is not divisible by 11, whereas 8924310064539≡8−9+2−4+3−1+0−0+6−4+4−3+9 ≡0

mod 11, and so 8924310064539 is divisible by 11.

32 Chapter 3

86 Example (Putnam, 1952) Let

f (x) =

n

¸

k=0

a

k

x

n−k

be a polynomial of degree n with integral coefﬁcients. If a

0

, a

n

and f (1) are all odd, prove that f (x) = 0 has no rational roots.

Solution: Suppose that f (a/b) = 0, where a and b are relatively prime integers. Then 0 = b

n

f (a/b) = a

0

b

n

+a

1

b

n−1

a + +

a

n−1

ba

n−1

+a

n

a

n

. By the relative primality of a and b it follows that a[a

0

, b[a

n

, whence a and b are both odd. Hence

a

0

b

n

+a

a

b

n−1

a + +a

n−1

ba

n−1

+a

n

a

n

≡a

0

+a

1

+ +a

n

= f (1) ≡1 mod 2,

but this contradicts that a/b is a root of f .

Practice

Problem 3.2.1 (AHSME 1991) An n-digit integer is cute if its

n digits are an arrangement of the set ¦1, 2, . . . , n¦ and its ﬁrst

k digits forman integer that is divisible by k for all k, 1 ≤k ≤n.

For example, 321 is a cute three-digit number because 1 di-

vides 3, 2 divides 32, and 3 divides 321. How many cute six-

digit integers are there?

Answer: 2.

Problem 3.2.2 How many ways are there to roll two distin-

guishable dice to yield a sum that is divisible by three?

Answer: 12.

Problem 3.2.3 Prove that a number is divisible by 2

k

, k ∈ N if

and only if the number formed by its last k digits is divisible by

2

k

. Test whether

90908766123456789999872

is divisible by 8.

Problem 3.2.4 An old receipt has faded. It reads 88 chickens

at the total of $x4.2y, where x and y are unreadable digits.

How much did each chicken cost?

Answer: 73 cents.

Problem 3.2.5 Five sailors plan to divide a pile of coconuts

amongst themselves in the morning. During the night, one of

them wakes up and decides to take his share. After throwing

a coconut to a monkey to make the division come out even, he

takes one ﬁfth of the pile and goes back to sleep. The other four

sailors do likewise, one after the other, each throwing a co-

conut to the monkey and taking one ﬁfth of the remaining pile.

In the morning the ﬁve sailors throw a coconut to the monkey

and divide the remaining coconuts into ﬁve equal piles. What

is the smallest amount of coconuts that could have been in the

original pile?

Answer: 15621

Problem 3.2.6 Prove that a number which consists of 3

n

iden-

tical digits is divisible by 3

n

. For example, 111 111 111 is

divisible by 9.

Problem 3.2.7 ((UM)

2

C

8

1991) Suppose that a

0

, a

1

, . . . a

n

are integers with a

n

= 0, and let

p(x) = a

0

+a

1

x + +a

n

x

n

.

Suppose that x

0

is a rational number such that p(x

0

) =0. Show

that if 1 ≤k ≤n, then

a

k

x

0

+a

k+1

x

2

0

+ +a

n

x

n−k+1

is an integer.

Problem 3.2.8 1953 digits are written in a circular order.

Prove that if the 1953-digit numbers obtained when we read

these digits in dextrogyral sense beginning with one of the dig-

its is divisible by 27, then if we read these digits in the same

direction beginning with any other digit, the new 1953-digit

number is also divisible by 27.

Problem 3.2.9 (Lagrange) Prove that

f

n+60

≡ f

n

mod 10.

Thus the last digit of a Fibonacci number recurs in cycles of

length 60.

Problem 3.2.10 Prove that

f

2n+1

≡ f

2

n+1

mod f

2

n

.

Complete Residues 33

3.3 Complete Residues

The following concept will play a central role in our study of integers.

87 Deﬁnition If a ≡b mod n then b is called a residue of a modulo n. A set a

1

, a

2

, . . . a

n

is called a complete residue system

modulo n if for every integer b there is exactly one index j such that b ≡a

j

mod n.

It is clear that given any ﬁnite set of integers, this set will form a complete set of residues modulo n if and only if the

set has n members and every member of the set is incongruent modulo n. For example, the set A = ¦0, 1, 2, 3, 4, 5¦ forms

a complete set of residues mod 6, since any integer x is congruent to one and only one member of A. Notice that the set

B = ¦−40, 6, 7, 15, 22, 35¦ forms a complete residue set mod 6, but the set C = ¦−3, −2, −1, 1, 2, 3¦ does not, as −3 ≡ 3

mod 6.

+

3

0 1 2

0 0 1 2

1 1 2 0

2 2 0 1

Table 3.1: Addition Table for Z

3

+

6

0 1 2 3 4 5

0 0 1 2 3 4 5

1 1 2 3 4 5 0

2 2 3 4 5 0 1

3 3 4 5 0 1 2

4 4 5 0 1 2 3

5 5 0 1 2 3 4

Table 3.2: Addition Table for Z

6

Tied up with the concept of complete residues is that of Z

n

. As an example, let us take n = 3. We now let 0 represent all

those integers that are divisible by 3, 1 represent all those integers that leave remainder 1 upon division by 3, and 2 all those

integers that leave remainder 2 upon division by 3, and consider the set Z

3

= ¦0, 1, 2¦. We deﬁne addition in Z

3

as follows.

Given a, b ∈ Z

3

we consider a +b mod 3. Now, there is c ∈ ¦0, 1, 2¦ such that a +b ≡ c mod 3. We then deﬁne a +

3

b to be

equal to c. Table ?? contains all the possible additions.

We observe that Z

3

together with the operation +

3

as given in Table ?? satisﬁes the following properties:

1. The element 0 ∈ Z

3

is an identity element for Z

3

, i.e. 0 satisﬁes 0 +

3

a = a +

3

0 = a for all a ∈ Z

3

2. Every element a ∈ Z

3

has an additive inverse b, i.e., an element such that a +

3

b = b +

3

a = 0. We denote the additive

inverse of a by −a. In Z

3

we note that −0 = 0, −1 = 2, −2 = 1.

3. The operation addition in Z

3

is associative, that is, for all a, b, c ∈ Z

3

we have a +

3

(b+

3

c) = (a +

3

b) +

3

c.

We then say that <Z

3

, +

3

> forms a group and we call it the group of residues under addition mod 3.

Similarly we deﬁne < Z

n

, +

n

>, as the group of residues under addition mod n. As a further example we present the

addition table for <Z

6

, +

6

> on Table (1.2). We will explore later the multiplicative structure of Z

n

.

Practice

Problem 3.3.1 Construct the addition tables for Z

8

and Z

9

. Problem 3.3.2 How many distinct ordered pairs (a, b) =

(0, 0) are in Z

12

such that a +

12

b = 0?

Chapter 4

Unique Factorisation

4.1 GCD and LCM

If a, b ∈ Z, not both zero, the largest positive integer that divides both a, b is called the greatest common divisor of a and b. This

is denoted by (a, b) or sometimes by gcd(a, b). Thus if d[a and d[b then d[(a, b), because any common divisor of a and b must

divide the largest common divisor of a and b. For example, (68, −6) = 2, gcd(1998, 1999) = 1.

If (a, b) = 1, we say that a and b are relatively prime or coprime. Thus if a, b are relatively prime, then they have no factor

greater than 1 in common.

If a, b are integers, not both zero, the smallest positive integer that is a multiple of a, b is called the least common multiple

of a and b. This is denoted by [a, b]. We see then that if a[c and if b[c, then [a, b][c, since c is a common multiple of both a and

b, it must be divisible by the smallest common multiple of a and b.

The most important theorem related to gcd’s is probably the following.

88 Theorem (Bachet-Bezout Theorem) The greatest common divisor of any two integers a, b can be written as a linear

combination of a and b, i.e., there are integers x, y with

(a, b) = ax +by.

Proof: Let A = ¦ax +by[ax +by > 0, x, y ∈ Z¦. Clearly one of ±a, ±b is in A, as both a, b are not zero. By the

Well Ordering Principle, A has a smallest element, say d. Therefore, there are x

0

, y

0

such that d = ax

0

+by

0

. We

prove that d = (a, b). To do this we prove that d[a, d[b and that if t[a, t[b, then t[d.

We ﬁrst prove that d[a. By the Division Algorithm, we can ﬁnd integers q, r, 0 ≤r < d such that a = dq +r. Then

r = a −dq = a(1 −qx

0

) −by

0

.

If r > 0, then r ∈ A is smaller than the smaller element of A, namely d, a contradiction. Thus r = 0. This entails

dq = a, i.e. d[a. We can similarly prove that d[b.

Assume that t[a, t[b. Then a = tm, b = tn for integers m, n. Hence d = ax

0

+bx

0

= t(mx

0

+ny

0

), that is, t[d. The

theorem is thus proved. u

It is clear that any linear combination of a, b is divisible by (a, b).

89 Lemma (Euclid’s Lemma) If a[bc and if (a, b) = 1, then a[c.

Proof: As (a, b) = 1, by the Bachet-Bezout Theorem, there are integers x, y with ax +by = 1. Since a[bc, there is

an integer s with as = bc. Then c = c 1 = cax +cby = cax +asy. From this it follows that a[c, as wanted.u

34

GCD and LCM 35

90 Theorem If (a, b) = d, then

(

a

d

,

b

d

) = 1.

Proof: By the Bachet-Bezout Theorem, there are integers x, y such that ax+by =d. But then (a/d)x+(b/d)y =1,

and a/d, b/d are integers. But this is a linear combination of a/d, b/d and so (a/d, b/d) divides this linear

combination, i.e., divides 1. We conclude that (a/d, b/d) = 1.u

91 Theorem Let c be a positive integer. Then

(ca, cb) = c(a, b).

Proof: Let d

1

= (ca, cb) and d

2

= (a, b). We prove that d

1

[cd

2

and cd

2

[d

1

. As d

2

[a and d

2

[b, then cd

2

[ca, cd

2

[cb.

Thus cd

2

is a common divisor of ca and cb and hence d

1

[cd

2

. By the Bachet-Bezout Theorem we can ﬁnd integers

x, y with d

1

= acx +bcy = c(ax +by). But ax +by is a linear combination of a, b and so it is divisible by d

2

. There

is an integer s then such that sd

2

= ax +by. It follows that d

1

= csd

2

, i.e., cd

2

[d

1

. u

It follows similarly that (ca, cb) =[c[(a, b) for any non-zero integer c.

92 Lemma For nonzero integers a, b, c,

(a, bc) = (a, (a, b)c).

Proof: Since (a, (a, b)c) divides (a, b)c it divides bc. Thus gcd(a, (a, b)c) divides a and bc and hence gcd(a, (a, b)c)[ gcd(a, bc).

On the other hand, (a, bc) divides a and bc, hence it divides ac and bc. Therefore (a, bc) divides (ac, bc) = c(a, b).

In conclusion, (a, bc) divides a and c(a, b) and so it divides (a, (a, b)c). This ﬁnishes the proof.u

93 Theorem (a

2

, b

2

) = (a, b)

2

.

Proof: Assume that (m, n) = 1. Using the preceding lemma twice,

(m

2

, n

2

) = (m

2

, (m

2

, n)n) = (m

2

, (n, (m, n)m)n).

As (m, n) = 1, this last quantity equals (m

2

, n). Using the preceding problem again,

(m

2

, n) = (n, (m, n)m) = 1.

Thus (m, n) = 1 implies (m

2

, n

2

) = 1.

By Theorem ??,

Å

a

(a, b)

,

b

(a, b)

ã

= 1,

and hence

Ç

a

2

(a, b)

2

,

b

2

(a, b)

2

å

= 1.

By Theorem ??, upon multiplying by (a, b)

2

, we deduce

(a

2

, b

2

) = (a, b)

2

,

which is what we wanted.u

94 Example Let (a, b) = 1. Prove that (a +b, a

2

−ab +b

2

) = 1 or 3.

36 Chapter 4

Solution: Let d = (a +b, a

2

−ab +b

2

). Now d divides

(a +b)

2

−a

2

+ab −b

2

= 3ab.

Hence d divides 3b(a +b) −3ab = 3b

2

. Similarly, d[3a

2

. But then d[(3a

2

, 3b

2

) = 3(a

2

, b

2

) = 3(a, b)

2

= 3.

95 Example Let a, a = 1, m, n be positive integers. Prove that

(a

m

−1, a

n

−1) = a

(m,n)

−1.

Solution: Set d = (m, n), sd = m, td = n. Then a

m

−1 = (a

d

)

s

−1 is divisible by a

d

−1 and similarly, a

n

−1 is divisible by

a

d

−1. Thus (a

d

−1)[(a

m

−1, a

n

−1). Now, by the Bachet-Bezout Theoremthere are integers x, y with mx+ny =d. Notice that

x and y must have opposite signs (they cannot obviously be both negative, since then d would be negative. They cannot both be

positive because then d ≥ m+n, when in fact we have d ≤ m, d ≤ n). So, assume without loss of generality that x > 0, y ≤ 0.

Set t = (a

m

−1, a

n

−1). Then t[(a

mx

−1) and t[(a

−ny

−1). Hence, t[((a

mx

−1) −a

d

(a

−ny

−1)) = a

d

−1. The assertion is

established.

96 Example (IMO, 1959) Prove that the fraction

21n +4

14n +3

is irreducible for every natural number n.

Solution: 2(21n +4) −3(14n +3) = −1. Thus the numerator and the denominator have no common factor greater than 1.

97 Example (AIME, 1985) The numbers in the sequence

101, 104, 109, 116, . . .

are of the form a

n

= 100 +n

2

, n = 1, 2, . . .. For each n let d

n

= (a

n

, a

n+1

). Find max

n≥1

d

n

.

Solution: We have the following: d

n

= (100 +n

2

, 100 + (n +1)

2

) = (100 +n

2

, 100 +n

2

+2n +1) = (100 +n

2

, 2n +1). Thus

d

n

[(2(100+n

2

)−n(2n+1)) =200−n. Therefore d

n

[(2(200−n)+(2n+1)) =401. This means that d

n

[401 for all n. Could it be

that large? The answer is yes, for let n = 200, then a

200

= 100+200

2

= 100(401) and a

201

= 100+201

2

= 40501 = 101(401).

Thus max

n≥1

d

n

= 401.

98 Example Prove that if m and n are natural numbers and m is odd, then (2

m

−1, 2

n

+1) = 1.

Solution: Let d = (2

m

−1, 2

n

+1). It follows that d must be an odd number, and 2

m

−1 = kd, 2

n

+1 = ld, for some natural

numbers k, l. Therefore, 2

mn

= (kd +1)

n

= td +1, where t =

n−1

¸

j=0

Ç

n

j

å

k

n−j

d

n−j−1

. In the same manner, 2

mn

= (ld −1)

m

=

ud −1, where we have used the fact that m is odd. As td +1 = ud −1, we must have d[2, whence d = 1.

99 Example Prove that there are arbitrarily long arithmetic progressions in which the terms are pairwise relatively prime.

Solution: The numbers km! +1, k = 1, 2, . . . , m form an arithmetic progression of length m and common difference m!. Suppose

that d[(lm! +1), d[(sm! +1), 1 ≤l < s ≤m. Then d[(s(lm! +1) −l(sm! +1)) = (s −l) < m. Thus 1 ≤d < m and so, d[m!. But

then d[(sm! +1 −sm!) = 1. This means that any two terms of this progression are coprime.

100 Example Prove that any two consecutive Fibonacci numbers are relatively prime.

Solution: Let d = ( f

n

, f

n+1

). As f

n+1

− f

n

= f

n−1

and d divides the sinistral side of this equality, d[ f

n−1

. Thus d[( f

n

− f

n−1

) =

f

n−2

. Iterating on this process we deduce that d[ f

1

= 1 and so d = 1.

Aliter: By Cassini’s Identity f

n−1

f

n+1

− f

2

n

= (−1)

n

. Thus d[(−1)

n

, i.e., d = 1.

GCD and LCM 37

101 Example Prove that

( f

m

, f

n

) = f

(n,m)

.

Solution: Set d = ( f

n

, f

m

), c = f

(m,n)

, a = (m, n). We will prove that c[d and d[c.

Since a[m and a[n, f

a

[ f

m

and f

a

[ f

n

by Theorem ??. Thus

f

a

[( f

m

, f

m

),

i.e., c[d.

Now, by the Bachet-Bezout Theorem, there are integers x, y such that xm+yn =a. Observe that x, y cannot be both negative,

otherwise a would be negative. As a[n, a[m we have a ≤n, a ≤m. They cannot be both positive since then a =xm+yn ≥m+n,

a contradiction. Thus they are of opposite signs, and we assume without loss of generality that x ≤0, y > 0.

Observe that

f

yn

= f

a−xm

= f

a−1

f

−xm

+ f

a

f

−xm+1

upon using the identity

f

s+t

= f

s−1

f

t

+ f

s

f

t+1

of Theorem ??. As n[yn, m[(−xm), we have that f

n

[ f

yn

, f

m

[ f

−xm

. This implies that ( f

n

, f

m

)[ f

yn

and ( f

n

, f

m

)[ f

−xm

. Hence

( f

n

, f

m

)[ f

a

f

−xm+1

.

We saw earlier that ( f

n

, f

m

)[ f

−xm

. If it were the case that

( f

n

, f

m

)[ f

−xm+1

,

then ( f

n

, f

m

) would be dividing two consecutive Fibonacci numbers, a contradiction to the preceding problem in the case when

( f

n

, f

m

) > 1. The case = 1 is a triviality. Therefore ( f

n

, f

m

)[ f

a

, which is what we wanted to prove.

102 Example Prove that no odd Fibonacci number is ever divisible by 17.

Solution: Let d = (17, f

n

), which obviously must be odd. Then (17, f

n

) = (34, f

n

) = ( f

9

, f

n

) = f

(9,n)

= f

1

, f

3

or f

9

. This means

that d = (17, f

n

) = 1, 2 or 34. This forces d = 1.

103 Example The Catalan number of order n is deﬁned as

C

n

=

1

n +1

Ç

2n

n

å

.

Prove that C

n

is an integer for all natural numbers n.

Solution: By the binomial absorption identity,

2n +1

n +1

Ç

2n

n

å

=

Ç

2n +1

n +1

å

.

Since 2n+1 and n+1 are relatively prime, and since the dextral side is an integer, it must be the case that n+1 divides

Ç

2n

n

å

.

104 Example Let n be a natural number. Find the greatest common divisor of

Ç

2n

1

å

,

Ç

2n

3

å

, . . . ,

Ç

2n

2n −1

å

.

38 Chapter 4

Solution: Since

n

¸

k=1

Ç

2n

2k −1

å

= 2

2n−1

,

the gcd must be of the form 2

a

. Since the gcd must divide

Ç

2n

1

å

= 2n, we see that it has divide 2

l+1

, where l is the largest

power of 2 that divides n. We claim that 2

l+1

divides all of them. We may write n = 2

l

m, where M is odd. Now,

Ç

2

l+1

m

2k −1

å

=

2

l+1

m

2k −1

Ç

2

l+1

m−1

2k −2

å

.

But 2k −1 [2

l+1

for k > 1. This establishes the claim.

105 Example Let any ﬁfty one integers be taken from amongst the numbers 1, 2, . . . , 100. Show that there are two that are

relatively prime.

Solution: Arrange the 100 integers into the 50 sets

¦1, 2¦, ¦3, 4¦, ¦5, 6¦. . ., ¦99, 100¦.

Since we are choosing ﬁfty one integers, there must be two that will lie in the same set. Those two are relatively prime, as

consecutive integers are relatively prime.

106 Example Prove that any natural number n > 6 can be written as the sum of two integers greater than 1, each of the

summands being relatively prime.

Solution: If n is odd, we may choose a = 2, b = n −2. If n is even, then is either of the form 4k or 4k +2. If n = 4k, then take

a = 2k +1, b = 2k −1. These two are clearly relatively prime (why?). If n = 4k +2, k > 1 take a = 2k +3, b = 2k −1.

107 Example How many positive integers ≤1260 are relatively prime to 1260?

Solution: As 1260 = 2

2

3

2

5 7, the problem amounts to ﬁnding those numbers less than 1260 which are not divisible by

2, 3, 5, or 7. Let A denote the set of integers ≤ 1260 which are multiples of 2, B the set of multiples of 3, etc. By the

Inclusion-Exclusion Principle,

[A∪B∪C∪D[ = [A[ +[B[ +[C[ +[D[

−[A∩B[ −[A∩C[ −[A∩D[

−[B∩C[ −[B∩D[ −[C∩D[

+[A∩B∩C[ +[A∩B∩D[ +[A∩C∩D[

+[B∩C∩D[ −[A∩B∩C∩D[

= 630 +420 +252+180−210−126−90−84

−60 −36 +42 +30+18+12−6 = 972.

The number of integers sought is then 1260 −972 = 288.

Practice

Problem 4.1.1 Show that

(a, b)[a, b] = ab

for all natural numbers a, b.

Problem 4.1.2 Find lcm (23!41!, 29!37!).

Primes 39

Problem 4.1.3 Find two positive integers a, b such that

a

2

+b

2

= 85113, and lcm (a, b) = 1764.

Problem 4.1.4 Find a, b ∈ N with (a, b) = 12, [a, b] = 432.

Problem 4.1.5 Prove that (a, b)

n

= (a

n

, b

n

) for all natural

numbers n.

Problem 4.1.6 Let a ∈N. Find, with proof, all b ∈Nsuch that

(2

b

−1)[(2

a

+1).

Problem 4.1.7 Show that (n

3

+3n +1, 7n

3

+18n

2

−n −2) =

1.

Problem 4.1.8 Let the integers a

n

, b

n

be deﬁned by the rela-

tion

a

n

+b

n

√

2 = (1 +

√

2)

n

, n ∈ N.

Prove that gcd(a

n

, b

n

) = 1 ∀ n.

Problem 4.1.9 Prove or disprove the following two proposi-

tions:

1. If a, b ∈ N, a < b, then in any set of b consecutive inte-

gers there are two whose product is divisible by ab.

2. If a, b, c, ∈ N, a < b < c, then in any set of c consecu-

tive integers there are three whose product is divisible

by abc.

Problem 4.1.10 Let n, k, n ≥k > 0 be integers. Prove that the

greatest common divisor of the numbers

Ç

n

k

å

,

Ç

n +1

k

å

, . . . ,

Ç

n +k

k

å

is 1.

(Hint: Prove

k

¸

j=0

(−1)

j

Ç

k

j

åÇ

n + j

k

å

= (−1)

k

.)

Problem 4.1.11 Let F

n

= 2

2

n

+1 be the n-th Fermat number.

Find (F

n

, F

m

).

Problem 4.1.12 Find the greatest common divisor of the se-

quence

16

n

+10n −1, n = 1, 2, . . . .

Problem 4.1.13 Demonstrate that (n! +1, (n +1)! +1) = 1.

Problem 4.1.14 Prove that any natural number n > 17 can

be written as n = a+b+c where a, b, c are pairwise relatively

prime natural numbers each exceeding 1.

(Hint: Consider n mod 12. Write two of the summands in the

form 6k +s and the third summand as a constant.)

Problem 4.1.15 Prove that there are no positive integers

a, b, n > 1 with

(a

n

−b

n

)[(a

n

+b

n

).

Problem 4.1.16 Prove that the binomial coefﬁcients have the

following hexagonal property:

gcd

ÇÇ

n −1

k −1

å

,

Ç

n

k +1

å

,

Ç

n +1

k

åå

equals

gcd

ÇÇ

n −1

k

å

,

Ç

n +1

k +1

å

,

Ç

n

k −1

åå

.

Problem 4.1.17 (Putnam, 1974) Call a set of integers con-

spiratorial if no three of them are pairwise relatively prime.

What is the largest number of elements in any conspiratorial

subset of the integers 1 through 16?

4.2 Primes

Recall that a prime number is a positive integer greater than 1 whose only positive divisors are itself and 1. Clearly 2 is the only

even prime and so 2 and 3 are the only consecutive integers which are prime. An integer different from 1 which is not prime is

called composite. It is clear that if n > 1 is composite then we can write n as n = ab, 1 < a ≤b < n, a, b ∈ N.

108 Theorem If n > 1, then n is divisible by at least one prime.

40 Chapter 4

Proof: Since n > 1, it has at least one divisor > 1. By the Well Ordering Principle, n must have a least positive

divisor greater than 1, say q. We claim that q is prime. For if not then we can write q as q = ab, 1 < a ≤b < q. But

then a is a divisor of n greater than 1 and smaller than q, which contradicts the minimality of q.u

109 Theorem (Euclid) There are inﬁnitely many primes.

Proof: Let p

1

, p

2

, . . . p

k

be a list of primes. Construct the integer

n = p

1

p

2

p

k

+1.

This integer is greater than 1 and so by the preceding problem, it must have a prime divisor p. Observe that p must

be different from any of p

1

, p

2

, . . . , p

k

since n leaves remainder 1 upon division by any of the p

i

. Thus we have

shown that no ﬁnite list of primes exhausts the set of primes, i.e., that the set of primes is inﬁnite.u

110 Lemma The product of two numbers of the form 4k +1 is again of that form.

Proof: (4a +1)(4b +1) = 4(4ab +a +b) +1.u

111 Theorem There are inﬁnitely many primes of the form 4n +3.

Proof: Any prime either equals 2, or is of the form 4k ±1. We will show that the collection of primes of the form

4k −1 is inexhaustible. Let

¦p

1

, p

2

, . . . p

n

¦

be any ﬁnite collection of primes of the form 4k −1. Construct the number

N = 4p

1

p

2

p

n

−1.

Since each p

k

is ≥3, N ≥11. Observe that N is not divisible by any of the primes in our collection. Now either N

is a prime, in which case it is a prime of the form 4k −1 not on the list, or it is a product of primes. In the latter

case, all of the prime factors of N cannot be of the form 4k +1, for the product of any two primes of this form is

again of this form, in view of the preceding problem. Thus N must be divisible by some prime of the form 4k −1

not on the list. We have thus shown that given any ﬁnite list of primes of the form 4k −1 we can always construct

an integer which is divisible by some prime of the form 4k −1 not on that list. The assertion follows. u

112 Example Prove that there are arbitrarily long strings that do not contain a prime number.

Solution: Let k ∈ N, k ≥2. Then each of the numbers

k! +2, . . . , k! +k

is composite.

113 Theorem If the positive integer n is composite, then it must have a prime factor p with p ≤

√

n.

Proof: Suppose that n = ab, 1 < a ≤b < n. If both a and b are >

√

n, then n = ab >

√

n

√

n = n, a contradiction.

Thus n has a factor = 1 and ≤

√

n, and hence a prime factor, which is ≤

√

n. u

114 Example Find the number of prime numbers ≤100.

Solution: Observe that

√

100 = 10. By the preceding theorem, all the composite numbers in the range 10 ≤ n ≤ 100 have

a prime factor amongst 2, 3, 5, or 7. Let A

m

denote the multiples of M which are ≤ 100. Then [A

2

[ = 50, [A

3

[ = 33, [A

5

[ =

Practice 41

20, [A

7

[ =14, [A

6

[ =16, [A

10

[ =10, [A

14

[ =7, [A

15

[ =6, [A

21

[ =4, [A

35

[ =2, [A

30

[ =3, [A

42

[ =2, [A

70

[ =1, [A

105

[ =0, [A

210

[ =0.

Thus the number of primes ≤100 is

= 100 − ( number of composites ≤1) −1

= 4 +100 − multiples of 2, 3, 5, or 7 ≤100 −1

= 4 +100 − (50 +33 +20+14) + (16+10 +7+6+4+2)

−(3 +2 +1 +0) −0−1

= 25,

where we have subtracted the 1, because 1 is neither prime nor composite.

115 Lemma If p is a prime,

Ç

p

k

å

is divisible by p for all 0 < k < p.

Proof:

Ç

p

k

å

=

p(p −1) (p −k +1)

k!

yields

k!

Ç

p

k

å

= p(p −1) (p −k +1),

whence p[k!

Ç

p

k

å

. Now, as k < p, p [k!. By Euclid’s Lemma, it must be the case that p[

Ç

p

k

å

.u

116 Example Prove that if p is a prime, then p divides 2

p

−2.

Solution: By the Binomial Theorem:

2

p

−2 = (1 +1)

p

−2 =

Ç

p

1

å

+

Ç

p

2

å

+ +

Ç

p

p −1

å

,

as

Ç

p

0

å

=

Ç

p

p

å

= 1. By the preceding lemma, p divides each of the terms on the dextral side of the above. This establishes

the assertion.

Practice

Problem 4.2.1 Prove that there are inﬁnitely many primes of

the form 6n +5.

Problem 4.2.2 Use the preceding problem to show that there

are inﬁnitely many primes p such that p −2 is not a prime.

Problem 4.2.3 If p and q are consecutive odd primes, prove

that the prime factorisation of p +q has at least three (not

necessarily distinct) primes.

Problem 4.2.4 1. Let p be a prime and let n ∈ N. Prove,

by induction on n, that p[(n

p

−n).

2. Extend this result to all n ∈ Z.

3. Prove Fermat’s Little Theorem: if p [n, then p[(n

p−1

−

1).

4. Prove that 42[n

7

−n, n ∈ Z.

5. Prove that 30[n

5

−n, n ∈ Z.

Problem 4.2.5 Let p be an odd prime and let (a, b) =1. Prove

that

Å

a +b,

a

p

+b

p

a +b

ã

divides p.

Problem 4.2.6 Prove that 3, 5, 7 is the only prime triplet of the

form p, p +2, p +4.

42 Chapter 4

Problem 4.2.7 Let n > 2. Prove that if one of the numbers 2

n

−1 and 2

n

+1 is prime, then the other is composite.

4.3 Fundamental Theorem of Arithmetic

Consider the integer 1332. It is clearly divisible by 2 and so we obtain 1332 = 2 666. Now, 666 is clearly divisible by 6, and

so 1332 = 2 2 3 111. Finally, 111 is also divisible by 3 and so we obtain 1332 = 2 2 3 3 37. We cannot further decompose

1332 as a product of positive integers greater than 1, as all 2, 3, 37 are prime. We will show now that such decomposition is

always possible for a positive integer greater than 1.

117 Theorem Every integer greater than 1 is a product of prime numbers.

Proof: Let n > 1. If n is a prime, then we have nothing to prove. Assume that n is composite and let q

1

be its least

proper divisor. By Theorem 4.5, q

1

is a prime. Set n = q

1

n

1

, 1 < n

1

< n. If n

1

is a prime, then we arrived at the

result. Otherwise, assume that n

1

is composite, and let q

2

be its least prime divisor, as guaranteed by Theorem 4.5.

We can write then n = q

1

q

2

n

2

, 1 <n

2

< n

1

< n. Continuing the argument, we arrive at a chain n > n

1

>n

2

> 1,

and this process must stop before n steps, as n is a positive integer. Eventually we then have n = q

1

q

2

q

s

. u

We may arrange the prime factorisation obtained in the preceding Theorem as follows,

n = p

a

1

1

p

a

2

2

p

a

k

k

, a

1

> 0, a

2

> 0, . . . , a

k

> 0,

p

1

< p

2

< < p

k

,

where the p

j

are primes. We call the preceding factorisation of n, the canonical factorisation of n. For example 2

3

3

2

5

2

7

3

is the

canonical factorisation of 617400.

118 Theorem (Fundamental Theorem of Arithmetic) Every integer > 1 can be represented as a product of primes in only

one way, apart from the order of the factors.

Proof: We prove that a positive integer greater than 1 can only have one canonical factorisation. Assume that

n = p

a

1

1

p

a

2

2

p

a

s

s

= q

b

1

1

q

b

2

2

q

b

t

t

are two canonical factorisations of n. By Euclid’s Lemma (example 1.2) we conclude that every p must be a q and

every q must be a p. This implies that s =t. Also, from p

1

< p

2

< < p

s

and q

1

<q

2

< <q

t

we conclude that

p

j

= q

j

, 1 ≤ j ≤s.

If a

j

> b

j

for some j then, upon dividing by p

b

j

j

, we obtain

p

a

1

1

p

a

2

2

p

a

j

−b

j

j

p

a

s

s

= p

b

1

1

p

b

2

2

p

b

j−1

j−1

p

b

j+1

j+1

p

b

s

s

,

which is impossible, as the sinistral side is divisible by p

j

and the dextral side is not. Similarly, the alternative

a

j

< b

j

for some j is ruled out and so a

j

= b

j

for all j. This ﬁnishes the proof. u

It is easily seen, by the Fundamental Theorem of Arithmetic, that if a has the prime factorisation a = p

a

1

1

p

a

2

2

p

a

n

n

and b

has the prime factorisation b = p

b

1

1

p

b

2

2

p

b

n

n

, (it may be the case that some of the a

k

and some of the b

k

are zero) then

(a, b) = p

min(a

1

,b

1

)

1

p

min(a

2

,b

2

)

2

p

min(a

n

,b

n

)

n

. (4.1)

and also

[a, b] = p

max(a

1

,b

1

)

1

p

max(a

2

,b

2

)

2

p

max(a

n

,b

n

)

n

. (4.2)

Since x +y = max(x, y) +min(x, y), it clearly follows that

ab = (a, b)[a, b].

Fundamental Theorem of Arithmetic 43

119 Example Prove that

√

2 is irrational.

Solution: Assume that

√

2 = a/b with relatively prime natural numbers a, b. Then 2b

2

= a

2

. The sinistral side of this last

equality has an odd number of prime factors (including repetitions), whereas the dextral side has an even number of prime

factors. This contradicts the Fundamental Theorem of Arithmetic.

120 Example Prove that if the polynomial

p(x) = a

0

x

n

+a

1

x

n−1

+ +a

n−1

x +a

n

with integral coefﬁcients assumes the value 7 for four integral values of x, then it cannot take the value 14 for any integral value

of x.

Solution: First observe that the integer 7 can be decomposed into at most three different integer factors 7 = −7(1)(−1). Assume

that p(a

k

) −7 = 0 for distinct a

k

, 1 ≤k ≤4. Then

p(x) −7 = (x −a

1

)(x −a

2

)(x −a

3

)(x −a

4

)q(x)

for a polynomial q with integer coefﬁcients. Assume that there is an integer M with p(m) = 14. Then

7 = p(m) −7 = (m−a

1

)(m−a

2

)(m−a

3

)(m−a

4

)q(m).

Since the factors m−a

k

are all distinct, we have decomposed the integer 7 into at least four different factors. This is impossible,

by the Fundamental Theorem of Arithmetic.

121 Example Prove that the product of three consecutive integers is never a perfect power (i.e., a perfect square or a perfect

cube, etc.).

Solution: Let the integer be (n−1)n(n+1) = (n

2

−1)n. Since n

2

−1 and n are relatively prime, by the Fundamental Theoremof

Arithmetic, n

2

−1 is a perfect kth power (k ≥2) and n is also a perfect kth power. But then, n

2

−1 and n

2

would be consecutive

perfect kth powers, sheer nonsense.

122 Example Prove that m

5

+3m

4

n −5m

3

n

2

−15m

2

n

3

+4mn

4

+12n

5

is never equal to 33.

Solution: Observe that

m

5

+3m

4

n −5m

3

n

2

−15m

2

n

3

+4mn

4

+12n

5

= (m−2n)(m−n)(m+n)(m+2n)(m+3n).

Now, 33 can be decomposed as the product of at most four different integers 33 = (−11)(3)(1)(−1). If n = 0, the factors in the

above product are all different. They cannot be multiply to 33, by the Fundamental Theorem of Arithmetic, as 33 is the product

of 4 different factors and the expression above is the product of 5 different factors for n = 0.. If n = 0, the product of the factors

is m

5

, and 33 is clearly not a ﬁfth power.

123 Example Prove that the sum

S = 1/2 +1/3 +1/4+ +1/n

is never an integer.

Solution: Let k be the largest integer such that 2

k

≤ n, and P the product of all the odd natural numbers not exceeding n. The

number 2

k−1

PS is a sum, all whose terms, except for 2

k−1

P

1

2

k

, are integers.

124 Example Prove that there is exactly one natural number n for with 2

8

+2

11

+2

n

is a perfect square.

44 Chapter 4

Solution: If k

2

= 2

8

+2

11

+2

n

= 2304 +2

n

= 48

2

+2

n

, then k

2

−48

2

= (k −48)(k +48) = 2

n

. By unique factorisation,

k −48 = 2

s

, k +48 = 2

t

, s +t = n. But then 2

t

−2

s

=96 = 3 2

5

or 2

s

(2

t−s

−1) =3 2

5

. By unique factorisation, s =5, t −s =2,

giving s +t = n = 12.

125 Example Prove that in any set of 33 distinct integers with prime factors amongst ¦5, 7, 11, 13, 23¦, there must be two

whose product is a square.

Solution: Any number in our set is going to have the form

5

a

7

b

11

c

13

d

23

f

.

Thus to each number in the set, we associate a vector (a, b, c, d, f ). These vectors come in 32 different ﬂavours, according to

the parity of the components. For example (even, odd, odd, even, odd) is one such class. Since we have 33 integers, two (at

least) will have the same parity in their exponents, and the product of these two will be a square.

126 Example (IMO, 1985) Given a set M of 1985 distinct positive integers, none with a prime factor greater than 26, prove

that M contains a subset of four distinct elements whose product is the fourth power of an integer.

Solution: Any number in our set is going to be of the form

2

a

3

b

5

c

7

d

11

f

13

g

17

h

19

j

23

k

.

Thus if we gather 513 of these numbers, we will have two different ones whose product is a square.

Start weeding out squares. Since we have 1985 > 513 numbers, we can ﬁnd a pair of distinct a

1

, b

1

such that a

1

b

1

= c

2

1

.

Delete this pair. From the 1983 integers remaining, we can ﬁnd a pair of distinct a

2

, b

2

such that a

2

b

2

= c

2

2

. Delete this pair.

From the 1981 integers remaining, we can ﬁnd a pair a

3

, b

3

such that a

3

b

3

= c

2

3

. We can continue this operation as long as

we have at least 513 integers. Thus we may perform this operation n +1 times, were n is the largest positive integer such that

1985 −2n ≥ 513, i.e., n = 736. Therefore, we are able to gather 737 pairs a

k

, b

k

such that a

k

b

k

= c

2

k

. Now, the 737 numbers

c

k

have all their prime factors smaller than 26, and since 737 > 513, we may ﬁnd two distinct c

m

say c

i

and c

j

, i = j, such that

c

i

c

j

= a

2

, a perfect square. But then c

i

c

j

= a

2

implies that a

i

b

i

a

j

b

j

= a

4

, a fourth power. Thus we have found four distinct

numbers in our set whose product is a fourth power.

127 Example Let any ﬁfty one integers be taken from amongst the numbers 1, 2, . . . , 100. Show that there must be one that

divides some other.

Solution: Any of the ﬁfty one integers can be written in the form 2

a

m, where m is odd. Since there are only ﬁfty odd integers

between 1 and 100, there are only ﬁfty possibilities for m. Thus two (at least) of the integers chosen must share the same odd

part, and thus the smaller will divide the larger.

128 Example (USAMO 1972) Prove that

[a, b, c]

2

[a, b][b, c][c, a]

=

(a, b, c)

2

(a, b)(b, c)(c, a)

.

Solution: Put

a =

¸

p

α

k

k

, b =

¸

p

β

k

k

, c =

¸

p

γ

k

k

,

with primes p

k

. The assertion is equivalent to showing

2max(α

k

, β

k

, γ

k

) −max(α

k

, β

k

) −max(α

k

, γ

k

) −max(β

k

, γ

k

)

= 2min(α

k

, β

k

, γ

k

) −min(α

k

, β

k

) −min(α

k

, γ

k

) −min(β

k

, γ

k

).

By symmetry, we may assume, without loss of generality, that α

k

≥β

k

≥γ

k

. The equation to be established reduces thus to the

identity

2α

k

−α

k

−α

k

−β

k

= 2γ

k

−β

k

−γ

k

−γ

k

.

Fundamental Theorem of Arithmetic 45

129 Example Prove that n = 24 is the largest natural number divisible by all integral a, 1 ≤a ≤

√

n.

Solution: Suppose n is divisible by all the integers ≤

√

n. Let p

1

= 2, p

2

= 3, . . . , p

l

be all the primes ≤

√

n, and let k

j

be the

unique integers such that p

k

j

j

≤

√

n < p

k

j

+1

j

. Clearly n

l/2

< p

k

1

+1

1

p

k

2

+1

2

p

k

l

+1

l

. Let lcm(1, 2, 3, . . . ,

√

n−1,

√

n) = K.

Clearly then K = p

k

1

1

p

k

2

2

p

k

l

l

. Hence p

k

1

+1

1

p

k

2

+1

2

p

k

l

+1

l

≤K

2

and thus n

l/2

< K

2

. By hypothesis, n must be divisible by K

and so K ≤ n. Consequently, n

l/2

< n

2

. This implies that l < 4 and so n < 49. By inspection, we see that the only valid values

for n are n = 2, 4, 6, 8, 12, 24.

130 Example (Irving Kaplansky) A positive integer n has the property that for 0 < l < m < n,

S = l + (l +1) +. . . +m

is never divisible by n. Prove that this is possible if and only if n is a power of 2.

Solution: Set n = s2

k

with s odd. If s = 1, 2S = (l +m)(m−l +1), which has one factor even and one factor odd, cannot be

divisible by 2n = 2

k+1

, since, its even factor is less than 2n. But if s > 1, then S is divisible by n, with 0 <l <m <n, if we take

m = (s +2

k+1

−1)/2

and

l =

®

1 +m−2

k+1

, s > 2

k+1

,

1 +m−s, s < 2

k+1

.

131 Example Let 0 < a

1

< a

2

< < a

k

≤n, where k >

n +1

2

, be integers. Prove that

a

1

+a

j

= a

r

is soluble.

Solution: The k −1 positive integers a

i

−a

1

, 2 ≤ i ≤ k, are clearly distinct. These, together with the k given distinct a’s, give

2k −1 > n positive integers, each not greater than n. Hence, at least one of the integers is common to both sets, so that at least

once a

r

−a

1

= a

j

.

The sequence n/2+1, n/2+2, . . ., n, shows that for k =(n +1)/2 the result is false.

132 Example Let 0 < a

1

< a

2

< < a

n

≤2n be integers such that the least common multiple of any two exceeds 2n. Prove

that a

1

>

2n

3

.

Solution: It is clear that no one of the numbers can divide another (otherwise we would have an lcm ≤ 2n). Hence, writing

a

k

= 2

t

k

A

k

, A

k

odd, we see that all the A

k

are different. Since there are n of them, they coincide in some order with the set of all

positive odd numbers less than 2n.

Now, consider a

1

= 2

t

1

A

1

. If a

1

≤2n/3, then 3a

1

= 2

t

1

3A

1

≤2n, and 3A

1

< 2n. Since 3A

1

would then be an odd number

< 2n, 3A

1

= A

j

for some j, and a

j

= 2

t

j

3A

1

. Thus either [a

1

, a

j

] = 2

t

1

3A

1

= 3a

1

≤ 2n, or [a

1

, a

j

] = 2

t

j

3A

1

= a

j

≤ 2n. These

contradictions establish the assertion.

133 Example (Putnam, 1980) Derive a formula for the number of quadruples (a, b, c, d) such that

3

r

7

s

= [a, b, c] = [b, c, d] = [c, d, a] = [d, a, b].

Solution: By unique factorisation, each of a, b, c, d must be of the form 3

m

7

n

, 0 ≤ m ≤ r, 0 ≤ n ≤ s. Moreover, M must equal

r for at least two of the four numbers, and n must equal s for at least two of the four numbers. There are

Ç

4

2

å

r

2

= 6r

2

ways

46 Chapter 4

of choosing exactly two of the four numbers to have exponent r,

Ç

4

3

å

r = 4r ways of choosing exactly three to have exponent

r and

Ç

4

4

å

= 1 of choosing the four to have exponent r. Thus there is a total of 1 +4r +6r

2

of choosing at least two of the

four numbers to have exponent r. Similarly, there are 1 +4s +6s

2

ways of choosing at least two of the four numbers to have

exponent s. The required formula is thus

(1 +4r +6r

2

)(1 +4s +6s

2

).

Practice

Problem 4.3.1 Prove that log

10

7 is irrational.

Problem 4.3.2 Prove that

log3

log2

is irrational.

Problem 4.3.3 Find the smallest positive integer such that

n/2 is a square and n/3 is a cube.

Problem 4.3.4 How many integers from 1 to 10

20

inclusive,

are not perfect squares, perfect cubes, or perfect ﬁfth powers?

Problem 4.3.5 Prove that the sum

1/3 +1/5 +1/7+ +1/(2n +1)

is never an integer.

(Hint: Look at the largest power of 3 ≤n).

Problem 4.3.6 Find min

k≥1

36

k

−5

k

.

(Hint: Why is 36

k

−1 −5

k

= 0?)

Problem 4.3.7 (AIME 1987) Find the number of ordered

triples (a, b, c) of positive integers for which [a, b] =

1000, [b, c] = [a, c] = 2000.

Problem 4.3.8 Find the number of ways of factoring 1332

as the product of two positive relatively prime factors each

greater than 1. Factorisations differing in order are consid-

ered the same.

Answer: 3.

Problem 4.3.9 Let p

1

, p

2

, . . . , p

t

be different primes and

a

1

, a

2

, . . . a

t

be natural numbers. Find the number of ways of

factoring p

a

1

1

p

a

2

2

p

a

t

t

as the product of two positive relatively

prime factors each greater than 1. Factorisations differing in

order are considered the same.

Answer: 2

t−1

−1.

Problem 4.3.10 Let n = p

a

1

1

p

a

2

2

p

a

t

t

and m = p

b

1

1

p

b

2

2

p

b

t

t

,

the p’s being different primes. Find the number of the common

factors of m and n.

Answer:

t

¸

k=1

(1 +min(a

k

, b

k

)).

Problem 4.3.11 (USAMO 1973) Show that the cube roots of

three distinct prime numbers cannot be three terms (not nec-

essarily consecutive) of an arithmetic progression.

Problem 4.3.12 Let 2 = p

1

, 3 = p

2

, . . . be the primes in their

natural order and suppose that n ≥10 and that 1 < j < n. Set

N

1

= p

1

p

2

p

j−1

−1, N

2

= 2p

1

p

2

p

j−1

−1, . . .

and

N

p

j

= p

j

p

1

p

2

p

j−1

−1

Prove

1. Each p

i

, j ≤ i ≤ n, divides at most one of the N

p

k

, 1 ≤

k ≤ j

2. There is a j, 1 < j < n, for which p

j

> n − j +1.

3. Let s be the smallest j for which p

j

> n − j +1. There

is a t, 1 ≤t ≤ p

s

, such that all of p

1

, . . . p

n

fail to divide

t p

1

p

2

p

s−1

−1, and hence p

n+1

< p

1

p

2

p

s

.

4. The s above is >4 and so p

s−1

−2 ≥s and p

1

p

2

p

s

<

p

s+1

p

n

.

5. (Bonse’s Inequality) For n ≥4, p

2

n+1

< p

1

p

n

.

Problem 4.3.13 Prove that 30 is the only integer n with the

following property: if 1 ≤t ≤n and (t, n) = 1, then t is prime.

Practice 47

Problem 4.3.14 (USAMO 1984) 1. For which positive

integers n is there a ﬁnite set S

n

of n distinct positive

integers such that the geometric mean of any subset of

S

n

is an integer?

2. Is there an inﬁnite set S of distinct positive integers such

that the geometric mean of any ﬁnite subset of S is an

integer.

Problem 4.3.15 1. (Putnam 1955) Prove that there is no

triplet of integers (a, b, c), except for (a, b, c) = (0, 0, 0)

for which

a +b

√

2 +c

√

3 = 0.

2. (Putnam 1980) Prove that there exist integers a, b, c,

not all zero and each of absolute value less than a mil-

lion, such that

[a +b

√

2+c

√

3[ < 10

−11

.

3. (Putnam 1980) Let a, b, c be integers, not all zero and

each of absolute value less than a million. Prove that

[a +b

√

2+c

√

3[ > 10

−21

.

Problem 4.3.16 (E˝ otv˝ os 1906) Let a

1

, a

2

, . . . , a

n

be any per-

mutation of the numbers 1, 2, . . . , n. Prove that if n is odd, the

product

(a

1

−1)(a

2

−2) (a

n

−n)

is an even number.

Problem 4.3.17 Prove that from any sequence formed by ar-

ranging in a certain way the numbers from 1 to 101, it is al-

ways possible to choose 11 numbers (which must not neces-

sarily be consecutive members of the sequence) which form an

increasing or a decreasing sequence.

Problem 4.3.18 Prove that from any ﬁfty two integers it is al-

ways to choose two, whose sum, or else, whose difference, is

divisible by 100.

Problem 4.3.19 Prove that from any one hundred integers it

is always possible to choose several numbers (or perhaps, one

number) whose sum is divisible by 100.

Problem 4.3.20 Given n numbers x

1

, x

2

, . . . , x

n

each of which

is equal to ±1, prove that if

x

1

x

2

+x

2

x

3

+ +x

n

x

1

= 0,

then n is a multiple of 4.

Chapter 5

Linear Diophantine Equations

5.1 Euclidean Algorithm

We nowexamine a procedure that avoids factorising two integers in order to obtain their greatest common divisor. It is called the

Euclidean Algorithm and it is described as follows. Let a, b be positive integers. After using the Division Algorithm repeatedly,

we ﬁnd the sequence of equalities

a = bq

1

+r

2

, 0 < r

2

< b,

b = r

2

q

2

+r

3

0 < r

3

< r

2

,

r

2

= r

3

q

3

+r

4

0 < r

4

< r

3

,

.

.

.

.

.

.

.

.

.

.

.

.

r

n−2

= r

n−1

q

n−1

+r

n

0 < r

n

< r

n−1

,

r

n−1

= r

n

q

n

.

(5.1)

The sequence of remainders will eventually reach a r

n+1

which will be zero, since b, r

2

, r

3

, . . . is a monotonically decreasing

sequence of integers, and cannot contain more than b positive terms.

The Euclidean Algorithm rests on the fact, to be proved below, that (a, b) = (b, r

2

) = (r

2

, r

3

) = = (r

n−1

, r

n

) = r

n

.

134 Theorem Prove that if a, b, n are positive integers, then

(a, b) = (a +nb, b).

Proof: Set d = (a, b), c = (a +nb, b). As d[a, d[b, it follows that d[(a +nb). Thus d is a common divisor of both

(a+nb) and b. This implies that d[c. On the other hand, c[(a+nb), c[b imply that c[((a+nb) −nb) = a. Thus c is

a common divisor of a and b, implying that c[d. This completes the proof. u

135 Example Use Theorem ?? to ﬁnd (3456, 246).

Solution: (3456, 246) = (13 246 +158, 246) = (158, 246), by the preceding example. Now, (158, 246) = (158, 158 +88) =

(88, 158). Finally, (88, 158) = (70, 88) = (18, 70) = (16, 18) = (2, 16) = 2. Hence (3456, 246) = 2.

136 Theorem If r

n

is the last non-zero remainder found in the process of the Euclidean Algorithm, then

r

n

= (a, b).

48

Euclidean Algorithm 49

Proof: From equations ??

r

2

= a −bq

1

r

3

= b −r

2

q

2

r

4

= r

2

−r

3

q

3

.

.

.

.

.

.

.

.

.

r

n

= r

n−2

−r

n−1

q

n−1

Let r = (a, b). From the ﬁrst equation, r[r

2

. From the second equation, r[r

3

. Upon iterating the process, we see that

r[r

n

.

But starting at the last equation ?? and working up, we see that r

n

[r

n−1

, r

n

[r

n−2

, . . . r

n

[r

2

, r

n

[b, r

n

[a. Thus r

n

is a

common divisor of a and b and so r

n

[(a, b). This gives the desired result. u

137 Example Find (23, 29) by means of the Euclidean Algorithm.

Solution: We have

29 = 1 23 +6,

23 = 3 6 +5,

6 = 1 5 +1,

5 = 5 1.

The last non-zero remainder is 1, thus (23, 29) = 1.

An equation which requires integer solutions is called a diophantine equation. By the Bachet-Bezout Theorem, we see that

the linear diophantine equation

ax +by = c

has a solution in integers if and only if (a, b)[c. The Euclidean Algorithmis an efﬁcient means to ﬁnd a solution to this equation.

138 Example Find integers x, y that satisfy the linear diophantine equation

23x +29y = 1.

Solution: We work upwards, starting from the penultimate equality in the preceding problem:

1 = 6 −1 5,

5 = 23 −3 6,

6 = 29 1 −23.

Hence,

1 = 6 −1 5

= 6 −1 (23 −3 6)

= 4 6 −1 23

= 4(29 1 −23) −1 23

= 4 29 −5 23.

This solves the equation, with x = −5, y = 4.

139 Example Find integer solutions to

23x +29y = 7.

Solution: From the preceding example, 23(−5) +29(4) = 1. Multiplying both sides of this equality by 7,

23(−35) +29(28) = 7,

which solves the problem.

50 Chapter 5

140 Example Find inﬁnitely many integer solutions to

23x +29y = 1.

Solution: By Example ??, the pair x

0

= −5, y

0

= 4 is a solution. We can ﬁnd a family of solutions by letting

x = −5 +29t, y = 4 −23t, t ∈ Z.

141 Example Can you ﬁnd integers x, y such that 3456x +246y = 73?

Solution: No. (3456, 246) = 2 and 2 [73.

142 Theorem Assume that a, b, c are integers such that (a, b)[c. Then given any solution (x

0

, y

0

) of the linear diophantine

equation

ax +by = c

any other solution of this equation will have the form

x = x

0

+t

b

d

, y = y

0

−t

a

d

,

where d = (a, b) and t ∈ Z.

Proof: It is clear that if (x

0

, y

0

) is a solution of ax +by = c, then x = x

0

+tb/d, y = y

0

−ta/d is also a solution.

Let us prove that any solution will have this form.

Let (x

′

, y

′

) satisfy ax

′

+by

′

= c. As ax

0

+by

0

= c also, we have

a(x

′

−x

0

) = b(y

0

−y

′

).

Dividing by d = (a, b),

a

d

(x

′

−x

0

) =

b

d

(y

0

−y

′

).

Since (a/d, b/d) = 1,

a

d

[(y

0

−y

′

), in virtue of Euclid’s Lemma. Thus there is an integer t such that t

a

d

= y

0

−y

′

,

that is, y = y

0

−ta/d. From this

a

d

(x

′

−x

0

) =

b

d

t

a

d

,

which is to say x

′

= x

0

+tb/d. This ﬁnishes the proof. u

143 Example Find all solutions in integers to

3456x +246y = 234.

Solution: By inspection, 3456(−1) +246(15) = 234. By Theorem ??, all the solutions are given by x = −1 +123t, y = 15 −

1728t, t ∈ Z.

Practice

Problem 5.1.1 Find the following:

1. (34567, 987)

2. (560, 600)

3. (4554, 36)

4. (8098643070, 8173826342)

Problem 5.1.2 Solve the following linear diophantine equa-

tions, provided solutions exist:

Linear Congruences 51

1. 24x +25y = 18

2. 3456x +246y = 44

3. 1998x +2000y = 33

Problem 5.1.3 Prove that the area of the triangle whose ver-

tices are (0, 0), (b, a), (x, y) is

[by −ax[

2

.

Problem 5.1.4 A woman pays $2.78 for some bananas and

eggs. If each banana costs $0.69 and each egg costs $0.35,

how many eggs and how many bananas did the woman buy?

5.2 Linear Congruences

We recall that the expression ax ≡ b mod n means that there is t ∈ Z such that ax = b +nt. Hence, the congruencial equation

in x, ax ≡ b mod n is soluble if and only if the linear diophantine equation ax +ny = b is soluble. It is clear then that the

congruence

ax ≡b mod n

has a solution if and only if (a, n)[b.

144 Theorem Let a, b, n be integers. If the congruence ax ≡b mod n has a solution, then it has (a, n) incongruent solutions

mod n.

Proof: From Theorem ?? we know that the solutions of the linear diophantine equation ax +ny = b have the

form x = x

0

+nt/d, y = y

0

−at/d, d = (a, n), t ∈ Z, where x

0

, y

0

satisfy ax

0

+ny = b. Letting t take on the values

t = 0, 1, . . . ((a, n) −1), we obtain (a, n) mutually incongruent solutions, since the absolute difference between any

two of them is less than n. If x = x

0

+nt

′

/d is any other solution, we write t

′

as t

′

= qd +r, 0 ≤r < d. Then

x = x

0

+n(qd +r)/d

= x

0

+nq +nr/d

≡ x

0

+nr/d mod n.

Thus every solution of the congruence ax ≡ b mod n is congruent mod n to one and only one of the d values

x

0

+nt/d, 0 ≤ t ≤ d −1. Thus if there is a solution to the congruence, then there are d incongruent solutions

mod n.u

145 Example Find all solutions to the congruence 5x ≡3 mod 7

Solution: Notice that according to Theorem ??, there should only be one solution mod 7, as (5, 7) = 1. We ﬁrst solve the

linear diophantine equation 5x +7y = 1. By the Euclidean Algorithm

7 = 5 1 +2

5 = 2 2 +1

2 = 2 1.

Hence,

1 = 5 −2 2

2 = 7 −5 1,

which gives

1 = 5 −2 2 = 5 −2(7 −5 1) = 5 3 −7 2.

Whence 3 = 5(9) −7(6). This gives 5 9 ≡3 mod 7 which is the same as 5 2 ≡3 mod 7. Thus x ≡2 mod 7.

146 Example Solve the congruence

3x ≡6 mod 12.

52 Chapter 5

Solution: As (3, 12) = 3 and 3[6, the congruence has three mutually incongruent solutions. By inspection we see that x = 2 is

a solution. By Theorem ??, all the solutions are thus of the form x = 2 +4t, t ∈ Z. By letting t = 0, 1, 2, the three incongruent

solutions modulo 12 are t = 2, 6, 10.

We now add a few theorems and deﬁnitions that will be of use in the future.

147 Theorem Let x, y be integers and let a, n be non-zero integers. Then

ax ≡ay mod n

if and only if

x ≡y mod

n

(a, n)

.

Proof: If ax ≡ay mod n then a(x −y) = sn for some integer s. This yields

(x −y)

a

(a, n)

= s

n

(a, n)

.

Since (a/(a, n), n/(a, n)) = 1 by Theorem ??, we must have

n

(a, n)

[(x −y),

by Euclid’s Lemma (Lemma ??). This implies that

x ≡y mod

n

(a, n)

.

Conversely if x ≡y mod

n

(a, n)

implies

ax ≡ay mod

an

(a, n)

,

upon multiplying by a. As (a, n) divides a, the above congruence implies a fortiori that ax −ay = tn for some

integer t. This gives the required result.u

Theorem ?? gives immediately the following corollary.

148 Corollary If ax ≡ay mod n and (a, n) = 1, then x ≡y mod n.

Practice

Problem 5.2.1 Solve the congruence 50x ≡12 mod 14. Problem 5.2.2 How many x, 38 ≤x ≤289 satisfy

3x ≡8 mod 11?

5.3 A theorem of Frobenius

If (a, b) = d > 1 then the linear form ax +by skips all non-multiples of d. If (a, b) = 1, there is always an integer solution

to ax +by = n regardless of the integer n. We will prove the following theorem of Frobenius that tells un when we will ﬁnd

nonnegative solutions to ax +by = n.

149 Theorem (Frobenius) Let a, b be positive integers. If (a, b) = 1 then the number of positive integers m that cannot be

written in the form ar +bs = m for nonnegative integers r, s equals (a −1)(b −1)/2.

A theorem of Frobenius 53

Proof: Let us say that an integer n is attainable if there are nonnegative integers r, s with ar +bs = n. Consider

the inﬁnite array

0 1 2 . . . k . . . a −1

a a +1 a +2 . . . a +k . . . 2a −1

2a 2a +1 2a +2 . . . 2a +k . . . 3a −1

. . . . . . . . . . . . . . . . . . . . .

The columns of this array are arithmetic progressions with common difference a. The numbers directly below a

number n have the form n +ka where k is a natural number. Clearly, if n is attainable, so is n +ka, implying thus

that if an integer n is attainable so is every integer directly below it. Clearly all multiples of b are attainable. We

claim that no two distinct multiples of b, vb and wb with 0 ≤ v, w ≤ a −1 can belong to the same column. If this

were so then we would have vb ≡ wb mod a. Hence a(v −w) ≡ 0 mod a. Since (a, b) = 1 we invoke Corollary

5.1 to deduce v −w ≡0 mod a. Since 0 ≤v, w ≤a −1, we must have v = w.

Now we show that any number directly above one of the multiples vb, 0 ≤v ≤a−1 is non-attainable. For a number

directly above vb is of the form vb−ka for some natural number k. If vb−ka were attainable, then ax+by =vb−ka

for some nonnegative integers x, y. This yields by ≤ ax +by = vb −ka < vb. Hence, 0 ≤ y < v < a. This implies

that y ≡ v mod b. On the other hand, two numbers on the same column are congruent mod a. Therefore we

deduce vb ≡ bv −ka ≡ ax +by mod a which yields bv ≡ by mod a. By Corollary ?? we obtain v ≡ y mod a.

This contradicts the fact that 0 ≤y < v < a.

Thus the number of unattainable numbers is precisely the numbers that occur just above a number of the form

vb, 0 ≤v ≤a−1. Now, on the j-th column, there are (vb− j)/a values above vb. Hence the number of unattainable

numbers is given by

a−1

¸

v=0

a−1

¸

j=0

vb − j

a

=

(a −1)(b −1)

2

,

as we wanted to show.u

The greatest unattainable integer occurs just above (a −1)b, hence the greatest value that is not attainable is (a −1)b −a,

which gives the following theorem.

150 Theorem Let a, b be relatively prime positive integers. Then the equation

ax +by = n

is unsoluble in nonnegative integers x, y for n =ab−a−b. If n >ab−a−b, then the equation is soluble in nonnegative integers.

151 Example (Putnam, 1971) A game of solitaire is played as follows. After each play, according to the outcome, the player

receives either a or b points, (a, b ∈ N, a > b), and his score accumulates from play to play. It has been noticed that there are

thirty ﬁve non-attainable scores and that one of these is 58. Find a and b.

Solution: The attainable scores are the nonnegative integers of the form ax +by. If (a, b) > 1, there are inﬁnitely many such

integers. Hence (a, b) =1. By Theorem??, the number of non-attainable scores is (a−1)(b−1)/2. Therefore, (a−1)(b−1) =

70 = 2(35) = 5(14) = 7(10). The conditions a > b, (a, b) = 1 yield the two possibilities a = 71, b = 2 and a = 11, b = 8. As

58 = 0 71 +2 29, the ﬁrst alternative is dismissed. The line 11x +8y = 58 passes through (6, −1) and (−2, 10) and thus it

does not pass through a lattice point in the ﬁrst quadrant. The unique solution is a = 11, b = 8.

152 Example (AIME, 1994) Ninety-four bricks, each measuring 4

′′

10

′′

19

′′

, are to be stacked one on top of another to

form a tower 94 bricks tall. Each brick can be oriented so it contributes 4

′′

or 10

′′

or 19

′′

to the total height of the tower. How

many different tower heights can be achieved using all 94 of the bricks?

54 Chapter 5

Solution: Let there be x, y, z bricks of height 4

′′

, 10

′′

, and 19

′′

respectively. We are asking for the number of different sums

4x +10y +19z

with the constraints x ≥0, y ≥0, z ≥0, x +y +z = 94.

Now, 4x +10y +19z ≤ 19 94 = 1786. Letting x = 94 −y −z, we count the number of different nonnegative integral

solutions to the inequality 376+3(2y +5z) ≤1786, y +z ≤94, that is 2y +5z ≤470, y +z ≤94. By Theorem ??, every integer

≥(2−1)(5−1) =4 can be written in the form 2y+5z, and the number of exceptions is (2−1)(5−1)/2 =2, namely n =1 and

n =3. Thus of the 471 nonnegative integers n ≤470, we see that 469 can be written in the formn =2y+5z. Using x =96−x−y,

n, 4 ≤ n ≤ 470 will be “good” only if we have 470 −n = 3x +5z. By Theorem ?? there are (3 −1)(5 −1)/2 = 4 exceptions,

each ≤ 8, namely n = 1, 2, 4, 7. This means that 463, 466, 468, and 469 are not representable in the form 4x +10y +19z. Then

every integer n, 0 ≤n ≤ 470 except for 1, 3, 463, 466, 468, and 469 can be thus represented, and the number of different sums

is 471 −6 = 465.

153 Example 1. Let (n, 1991) = 1. Prove that

n

1991

is the sum of two positive integers with denominator < 1991 if an

only if there exist integers m, a, b with

(∗) 1 ≤m ≤10, a ≥1, b ≥1, mn = 11a +181b.

2. Find the largest positive rational with denominator 1991 that cannot be written as the sum of two positive rationals each

with denominators less than 1991.

Solution: (a) If (∗) holds then

n

1991

=

a

181m

+

b

11m

does the trick. Conversely, if

n

1991

=

a

r

+

b

s

for a, b ≥1, (a, r) = (b, s) =1,

and r, s < 1991, we may suppose r = 181r

1

, s = 11s

1

and then nr

1

s

1

= 11as

1

+181br

1

, which leads to r

1

[11as

1

and so r

1

[s

1

.

Similarly, s

1

[r

1

, whence r

1

= s

1

= m, say, and (∗) follows.

(b) Any n > 170, (n, 1991) = 1 satisﬁes (∗) with b = 1 and M such that mn is of the form mn ≡ 181 mod 11. For mn > 181

except if m = 1, n ≤180; but then n would not be of the form n ≡181 mod 11.

But n = 170 does not satisfy (∗); for we would have 170 ≡ 181b mod 11, so b ≡ m mod 11, which yields b ≥ m, but

170m < 181. The answer is thus 170/1991.

Practice

Problem 5.3.1 Let a, b, c be positive real numbers. Prove that

there are at least c

2

/2ab pairs of integers (x, y) satisfying

x ≥0, y ≥0, ax +by ≤c.

Problem 5.3.2 (AIME, 1995) What is largest positive integer

that is not the sum of a positive integral multiple of 42 and a

positive composite integer?

Problem 5.3.3 Let a > 0, b > 0, (a, b) = 1. Then the number

of nonnegative solutions to the equation ax +by = n is equal

to

[

n

ab

] or [

n

ab

] +1.

(Hint: [s] − [t] = [s −t] or [s −t] +1.)

Problem 5.3.4 Let a, b ∈ N, (a, b) = 1. Let S(n) denote the

number of nonnegative solutions to

ax +by = n.

Evaluate

lim

n→∞

S(n)

n

.

Problem 5.3.5 (IMO, 1983) Let a, b, c be pairwise relatively

prime integers. Demonstrate that 2abc −ab −bc −ca is the

largest integer not of the form

bcx +acy +abz, x ≥0, y ≥0, z ≥0.

Chinese Remainder Theorem 55

5.4 Chinese Remainder Theorem

In this section we consider the case when we have multiple congruences. Consider the following problem: ﬁnd an integer x

which leaves remainder 2 when divided by 5, is divisible by 7, and leaves remainder 4 when divided by 11. In the language of

congruences we are seeking x such that

x ≡ 2 mod 5,

x ≡ 0 mod 7,

x ≡ 4 mod 11.

One may check that x = 147 satisﬁes the requirements, and that in fact, so does the parametric family x = 147 +385t, t ∈ Z.

We will develop a method to solve congruences like this one. The method is credited to the ancient Chinese, and it is thus

called the Chinese Remainder Theorem.

154 Example Find x such that

x ≡3 mod 5 and x ≡7 mod 11.

Solution: Since x = 3 +5a, we have 11x = 33 +55a. As x = 7 +11b, we have 5x = 35 +55b. Thus x = 11x −10x = 33 −70 +

55a −110b. This means that x ≡ −37 ≡ 18 mod 55. One veriﬁes that all the numbers x = 18 +55t, t ∈ Z verify the given

congruences.

155 Example Find a number n such that when divided by 4 leaves remainder 2, when divided by 5 leaves remainder 1, and

when divided by 7 leaves remainder 1.

Solution: We want n such that

n ≡ 2 mod 4,

n ≡ 1 mod 5,

n ≡ 1 mod 7.

This implies that

35n ≡ 70 mod 140,

28n ≡ 28 mod 140,

20n ≡ 20 mod 140.

As n = 21n −20n, we have n ≡ 3(35n −28n) −20n ≡ 3(70 −28) −20 ≡ 106 mod 140. Thus all n ≡ 106 mod 140 will

do.

156 Theorem (Chinese Remainder Theorem) Let m

1

, m

2

, . . . m

k

be pairwise relatively prime positive integers, each exceed-

ing 1, and let a

1

, a

2

, . . . a

k

be arbitrary integers. Then the system of congruences

x ≡ a

1

mod m

1

x ≡ a

2

mod m

2

.

.

.

.

.

.

.

.

.

x ≡ a

k

mod m

k

has a unique solution modulo m

1

m

2

m

k

.

Proof: Set P

j

= m

1

m

2

m

k

/m

j

, 1 ≤ j ≤ k. Let Q

j

be the inverse of P

j

mod m

j

, i.e., P

j

Q

j

≡ 1 mod m

j

, which

we know exists since all the m

i

are pairwise relatively prime. Form the number

x = a

1

P

1

Q

1

+a

2

P

2

Q

2

+ +a

k

P

k

Q

k

.

This number clearly satisﬁes the conditions of the theorem. The uniqueness of the solution modulo m

1

m

2

m

k

can

be easily established. u

56 Chapter 5

157 Example Can one ﬁnd one million consecutive integers that are not square-free?

Solution: Yes. Let p

1

, p

2

, . . . , p

1000000

be a million different primes. By the Chinese Remainder Theorem, there exists a solution

to the following system of congruences.

x ≡ −1 mod p

2

1

,

x ≡ −2 mod p

2

2

,

.

.

.

.

.

.

.

.

.

.

.

.

x ≡ −1000000 mod p

2

1000000

.

The numbers x+1, x+2, . . . , x+1000000 are a million consecutive integers, each of which is divisible by the square of a prime.

Practice

Problem 5.4.1 Solve the following systems:

1. x ≡−1 mod 4; x ≡2 mod 5

2. 4x ≡3 mod 7; x ≡10 mod 11

3. 5x ≡2 mod 8; 3x ≡2 mod 9; x ≡0 mod 11

Problem 5.4.2 (USAMO 1986) 1. Do there exist fourteen

consecutive positive integers each of which is divisible

by one or more primes p, 2 ≤ p ≤11?

2. Do there exist twenty-one consecutive integers each of

which is divisible by one or more primes p, 2 ≤ p ≤13?

Chapter 6

Number-Theoretic Functions

6.1 Greatest Integer Function

The largest integer not exceeding x is denoted by x or x. We also call this function the ﬂoor function. Thus x satisﬁes

the inequalities x −1 < x ≤ x, which, of course, can also be written as x ≤ x < x+1. The fact that x is the unique

integer satisfying these inequalities, is often of use. We also utilise the notation ¦x¦ = x −x, to denote the fractional part of

x, and [[x[[ = min

n∈Z

[x −n[ to denote the distance of a real number to its nearest integer. A useful fact is that we can write any real

number x in the form x =x+¦x¦, 0 ≤¦x¦ < 1.

The greatest integer function enjoys the following properties:

158 Theorem Let α, β ∈ R, a ∈ Z, n ∈ N. Then

1. α +a =α+a

2.

α

n

=

α

n

3. α+β ≤α +β ≤α+β+1

Proof:

1. Let m = α +a. Then m ≤ α +a < m+1. Hence m−a ≤ α < m−a +1. This means that m−a = α,

which is what we wanted.

2. Write α/n as α/n =α/n+θ, 0 ≤θ < 1. Since nα/n is an integer, we deduce by (1) that

α =nα/n+nθ = nα/n+nθ.

Now, 0 ≤nθ ≤nθ < n, and so 0 ≤nθ/n < 1. If we let Θ =nθ/n, we obtain

α

n

=

α

n

+Θ, 0 ≤Θ < 1.

This yields the required result.

3. From the inequalities α −1 < α ≤ α, β −1 < β ≤ β we get α +β −2 < α+β ≤ α +β. Since

α+β is an integer less than or equal to α+β, it must be less than or equal to the integral part of α+β,

i.e. α +β. We obtain thus α+β ≤α +β. Also, α +β is less than the integer α+β+2, so

its integer part α +β must be less than α+β+2, but α +β < α+β+2 yields α +β ≤

α+β+1. This proves the inequalities.

u

57

58 Chapter 6

159 Example Find a non-zero polynomial P(x, y) such that

P(2t, 3t) = 0

for all real t.

Solution: We claim that 3[2t] −2[3t] = 0, ±1 or −2. We can then take

P(x, y) = (3x −2y)(3x −2y −1)(3x −2y +1)(3x −2y +2).

In order to prove the claim, we observe that x has unit period, so it is enough to prove the claim for t ∈ [0, 1). We divide

[0, 1) as

[0, 1) = [0, 1/3) ∪[1/3, 1/2) ∪[1/2, 2/3) ∪[2/3, 1).

If t ∈ [0, 1/3), then both 2t and 3t are = 0, and so 32t−23t = 0. If t ∈ [1/3, 1/2) then [3t] = 1 and [2t] = 0, and so

32t−23t= −2. If t ∈[1/2, 2/3), then [2t] =1, [3t] =1, and so 32t−23t=1. If t ∈[2/3, 1), then 2t =1, 3t =2,

and 32t−23t = −1.

160 Example Describe all integers n such that 1 +

√

2n

2n.

Solution: Let 2n = m(1 +

√

2n). If m ≤

√

2n−1 then 2n ≤ (

√

2n−1)(

√

2n+1) =

√

2n

2

−1 ≤ 2n −1 < 2n, a

contradiction. If m≥

√

2n+1, then 2n ≥(

√

2n

2

+1)

2

≥2n+1, another contradiction. It must be the case that m=

√

2n.

Conversely, let n =

l(l +1)

2

. Since l <

√

2n < l +1, l =

√

2n. So all the integers with the required property are the

triangular numbers.

161 Example Prove that the integers

Ä

1 +

√

2

ä

n

**with n a nonnegative integer, are alternately even or odd.
**

Solution: By the Binomial Theorem

(1 +

√

2)

n

+ (1 −

√

2)

n

= 2

¸

0≤k≤n/2

(2)

k

Ç

n

2k

å

:= 2N,

an even integer. Since −1 < 1−

√

2 < 0, it must be the case that (1−

√

2)

n

is the fractional part of (1+

√

2)

n

or (1+

√

2)

n

+1

depending on whether n is odd or even, respectively. Thus for odd n, (1 +

√

2)

n

−1 < (1 +

√

2)

n

+ (1 −

√

2)

n

< (1 +

√

2)

n

,

whence (1+

√

2)

n

+ (1−

√

2)

n

=(1+

√

2)

n

, always even, and for n even 2N := (1+

√

2)

n

+ (1−

√

2)

n

= (1+

√

2)

n

+1,

and so (1 +

√

2)

n

= 2N−1, always odd for even n.

162 Example Prove that the ﬁrst thousand digits after the decimal point in

(6 +

√

35)

1980

are all 9’s.

Solution: Reasoning as in the preceding problem,

(6 +

√

35)

1980

+ (6 −

√

35)

1980

= 2k,

Greatest Integer Function 59

an even integer. But 0 < 6 −

√

35 < 1/10, (for if

1

10

< 6 −

√

35, upon squaring 3500 < 3481, which is clearly nonsense), and

hence 0 < (6 −

√

35)

1980

< 10

−1980

which yields

2k −1 + 0.9. . . 9

. .. .

1979 nines

= 2k −

1

10

1980

< (6 +

√

35)

1980

< 2k,

This proves the assertion of the problem.

163 Example (Putnam 1948) If n is a positive integer, demonstrate that

√

n+

√

n +1 =

√

4n +2.

Solution: By squaring, it is easy to see that

√

4n +1 <

√

n+

√

n +1 <

√

4n +3.

Neither 4n +2 nor 4n +3 are squares since squares are either congruent to 0 or 1 mod 4, so

√

4n +2 =

√

4n +3,

and the result follows.

164 Example Find a formula for the n-th non-square.

Solution: Let T

n

be the n-th non-square. There is a natural number m such that m

2

< T

n

< (m+1)

2

. As there are m squares less

than T

n

and n non-squares up to T

n

, we see that T

n

= n+m. We have then m

2

< n+m < (m+1)

2

or m

2

−m < n < m

2

+m+1.

Since n, m

2

−m, m

2

+m+1 are all integers, these inequalities imply m

2

−m+

1

4

<n < m

2

+m+

1

4

, that is to say, (m−1/2)

2

<

n < (m+1/2)

2

. But then m =

√

n+

1

2

. Thus the n-th non-square is T

n

= n +

√

n+1/2.

165 Example (Putnam 1983) Let f (n) = n +

√

n. Prove that for every positive integer m, the sequence

m, f (m), f ( f (m)), f ( f ( f (m))), . . .

contains at least one square of an integer.

Solution: Let m = k

2

+ j, 0 ≤ j ≤ 2k. Split the m’s into two sets, the set A of all the m with excess j, 0 ≤ j ≤ k and the set B

with all those m’s with excess j, k < j < 2k +1.

Observe that k

2

≤ m < (k +1)

2

= k

2

+2k +1. If j = 0, we have nothing to prove. Assume that m ∈ B. As

√

m = k,

f (m) =k

2

+ j +k = (k +1)

2

+ j −k −1, with 0 ≤ j −k −1 ≤k −1 <k +1. This means that either f (m) is a square or f (m) ∈A.

It is thus enough to consider the alternative m ∈ A, in which case

√

m+k = k and

f ( f (m)) = f (m+k) = m+2k = (k +1)

2

+ j −1.

This means that f ( f (m)) is either a square or f ( f (m)) ∈ A with an excess j −1 smaller than the excess j of m. At each iteration

the excess will reduce and eventually it will hit 0, whence we reach a square.

166 Example Solve the equation

x

2

−x −2 =x,

for x ∈ R.

Solution: Observe that a = b if and only if ∃k ∈ Z with a, b ∈ [k, k +1) which happens if and only if [a −b[ < 1. Hence,

the given equation has a solution if and only if [x

2

−2x −2[ < 1. Solving these inequalities it is easy to see that the solution is

thus

x ∈ (−1,

1

2

(1 −

√

5)] ∪[

1

2

(1 +

√

17),

1

2

(1 +

√

21)).

60 Chapter 6

167 Theorem If a, b are relatively prime natural numbers then

a−1

¸

k=1

kb

a

=

b−1

¸

k=1

ka

b

=

(a −1)(b −1)

2

.

Proof: Consider the rectangle with vertices at (0, 0), (0, b), (a, 0), (a, b). This rectangle contains (a −1)(b −1)

lattice points, i.e., points with integer coordinates. This rectangle is split into two halves by the line y =

xb

a

.

We claim that there are no lattice points on this line, except for the endpoints. For if there were a lattice point

(m, n), 0 <m<a, 0 <n <b, then

n

m

=

b

a

. Thus n/m is a reduction for the irreducible fraction b/a, a contradiction.

The points L

k

= (k,

kb

a

), 1 ≤k ≤a −1 are each on this line. Now,

kb

a

equals the number of lattice points on the

vertical line that goes from (k, 0) to (k,

kb

a

), i.e.

a−1

¸

k=1

kb

a

is the number of lattice points on the lower half of the

rectangle. Similarly,

b−1

¸

k=1

ka

b

equals the number of lattice points on the upper half of the rectangle. Since there

are (a−1)(b−1) lattice points in total, and their number is shared equally by the halves, the assertion follows. u

168 Example Find the integral part of

10

6

¸

k=1

1

√

k

.

Solution: The function x →x

−1/2

is decreasing. Thus for positive integer k,

1

√

k +1

<

k+1

k

dx

√

x

<

1

√

k

.

Summing from k = 1 to k = 10

6

−1 we deduce

10

6

¸

k=2

1

√

k

<

10

6

1

dx

√

x

<

10

6

−1

¸

k=1

1

√

k

.

The integral is easily seen to be 1998. Hence

1998 +1/10

3

<

10

6

¸

k=1

1

√

k

< 1999.

The integral part sought is thus 1998.

Practice

Problem 6.1.1 Prove that for all real numbers x, y,

x+x +y+y ≤2x+2y

holds.

Problem 6.1.2 If x, y real numbers, when is it true that

xy ≤xy?

Problem 6.1.3 If n > 1 is a natural number and α ≥ 1 is a

real number, prove that

[α] >

α

n

.

Practice 61

Problem 6.1.4 If a, b, n are positive integers, prove that

ab

n

≥a

b

n

.

Problem 6.1.5 Let α be a real number. Prove that [α] +

[−α] = −1 or 0 and that α−2α/2 = 0 or 1.

Problem 6.1.6 Prove that

(2 +

√

3)

n

**is an odd integer.
**

Problem 6.1.7 Show that the n-th element of the sequence

1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, . . .

where there are n occurrences of the integer n is

√

2n+1/2.

Problem 6.1.8 Prove Hermite’s Identity: if x is a real number

and n is a natural number then

nx =x+x +

1

n

+x +

2

n

+ +x +

n −1

n

.

Problem 6.1.9 Prove that for all integers m, n, the equality

m+n

2

+

n −m+1

2

= n

holds.

Problem 6.1.10 If a, b, c, d are positive real numbers such

that

na+nb =nc+nd

for all natural numbers n, prove that

a +b = c +d.

Problem 6.1.11 If n is a natural number, prove that

n +2 −n/25

3

=

8n +24

25

.

Problem 6.1.12 Solve the equation

x

1994

=

x

1995

.

Problem 6.1.13 Let [α, β] be an interval which contains no

integers. Prove that there is a positive integer n such that

[nα, nβ] still contains no integers but has length at least 1/6.

Problem 6.1.14 (IMO 1968) For every natural number n,

evaluate the sum

∞

¸

k=0

n +2

k

2

k+1

.

Problem 6.1.15 (Putnam 1973) Prove that if n ∈ N,

min

k∈N

(k +n/k) =

√

4n +1.

Problem 6.1.16 (Dirichlet’s principle of the hyperbola)

Let N be the number of integer solutions to xy ≤n, x >0, y >0.

Prove that

N =

n

¸

k=1

n

k

= 2

¸

1≤k≤

√

n

n

k

−

√

n

2

.

Problem 6.1.17 (Circle Problem) Let r > 0 and let T denote

the number of lattice points of the domain x

2

+y

2

≤ r

2

. Prove

that

T = 1 +4r+8

¸

0<x≤r

√

2

r

2

−x

2

+4

r

√

2

2

.

Problem 6.1.18 Let d = (a, b). Prove that

¸

1≤n≤b−1

an

b

=

(a −1)(b −1)

2

+

d −1

2

.

Problem 6.1.19 (Eisenstein) If (a, b) = 1 and a, b are odd,

then

¸

1≤n≤(b−1)/2

an

b

+

¸

1≤n≤(a−1)/2

bn

a

=

(a −1)(b −1)

4

.

Problem 6.1.20 Let m ∈ N with m > 1 and let y be a positive

real number. Prove that

¸

x

m

…

y

x

=y,

where the summation runs through all positive integers x not

divisible by the mth power of an integer exceeding 1.

Problem 6.1.21 For which natural numbers n will 112 divide

4

n

−(2 +

√

2)

n

?

Problem 6.1.22 A triangular number is a number of the form

1+2+ +n, n ∈N. Find a formula for the nth non-triangular

number.

Problem 6.1.23 (AIME 1985) How many of the ﬁrst thou-

sand positive integers can be expressed in the form

2x+4x+6x+8x?

62 Chapter 6

Problem 6.1.24 (AIME 1987) What is the largest positive in-

teger n for which there is a unique integer k such that

8

15

<

n

n +k

<

7

13

?

Problem 6.1.25 Prove that if p is an odd prime, then

(2 +

√

5)

p

−2

p+1

is divisible by p.

Problem 6.1.26 Prove that the n-th number not of the form

e

k

, k = 1, 2, . . . is

T

n

= n +ln(n +1 +ln(n +1)).

Problem 6.1.27 (Leningrad Olympiad) How many different

integers are there in the sequence

1

2

1980

,

2

2

1980

, . . . ,

1980

2

1980

?

Problem 6.1.28 Let k ≥ 2 be a natural number and x a posi-

tive real number. Prove that

k

√

x =

k

»

x.

Problem 6.1.29 1. Find a real number x = 0 such that

x, 2x, . . . , 34x have no 7’s in their decimal expansions.

2. Prove that for any real number x = 0 at least one of

x, 2x, . . . 79x has a 7 in its decimal expansion.

3. Can you improve the “gap” between 34 and 79?

Problem 6.1.30 (AIME 1991) Suppose that r is a real num-

ber for which

91

¸

k=19

r +

k

100

= 546.

Find the value of 100r.

Problem 6.1.31 (AIME 1995) Let f (n) denote the integer

closest to n

1/4

, when n is a natural number. Find the exact

numerical value of

1995

¸

n=1

1

f (n)

.

Problem 6.1.32 Prove that

1

0

(−1)

1994x+1995x

Ç

1993

1994x

åÇ

1994

1995x

å

dx = 0.

Problem 6.1.33 Prove that

√

n+

√

n +1 =

√

n+

√

n +2.

Problem 6.1.34 (Putnam 1976) Prove that

lim

n→∞

¸

1≤k≤n

Å

2n

k

−2

n

k

ã

= ln4 −1.

Problem 6.1.35 (Putnam 1983) Prove that

lim

n→∞

1

n

n

1

n

x

dx = log

3

(4/π).

You may appeal to Wallis Product Formula:

2

1

2

3

4

3

4

5

6

5

6

7

8

7

8

9

=

π

2

.

6.2 De Polignac’s Formula

We will consider now the following result due to De Polignac.

169 Theorem (De Polignac’s Formula) The highest power of a prime p dividing n! is given by

∞

¸

k=1

n

p

k

.

Proof: The number of integers contributing a factor of p is n/p, the number of factors contributing a second

factor of p is n/p

2

, etc..u

170 Example How many zeroes are at the end of 300!?

De Polignac’s Formula 63

Solution: The number of zeroes is determined by how many times 10 divides into 300. Since there are more factors of 2 in 300!

than factors of 5, the number of zeroes is thus determined by the highest power of 5 in 300!. By De Polignac’s Formula this is

∞

¸

k=1

300/5

k

= 60 +12 +2 = 74.

171 Example Does

7

Ç

1000

500

å

?

Solution: The highest power of 7 dividing into 1000! is 1000/7+1000/7

2

+1000/7

3

= 142+20+2 = 164. Similarly,

the highest power of 7 dividing into 500! is 71 +10 +1 = 82. Since

Ç

1000

500

å

=

1000!

(500!)

2

, the highest power of 7 that divides

Ç

1000

500

å

is 164 −2 82 = 0, and so 7 does not divide

Ç

1000

500

å

.

172 Example Let n = n

1

+n

2

+ +n

k

where the n

i

are nonnegative integers. Prove that the quantity

n!

n

1

!n

2

! n

k

!

is an integer.

Solution: From (3) in Theorem ?? we deduce by induction that

a

1

+a

2

+ +a

l

≤a

1

+a

2

+ +a

l

.

For any prime p, the power of p dividing n! is

¸

j≥1

n/p

j

=

¸

j≥1

(n

1

+n

2

+ +n

k

)/p

j

.

The power of p dividing n

1

!n

2

! n

k

! is

¸

j≥1

n

1

/p

j

+n

2

/p

j

+ n

k

/p

j

.

Since

n

1

/p

j

+n

2

/p

j

+ +n

k

/p

j

≤(n

1

+n

2

+ +n

k

)/p

j

,

we see that the power of any prime dividing the numerator of

n!

n

1

!n

2

! n

k

!

is at least the power of the same prime dividing the denominator, which establishes the assertion.

173 Example Given a positive integer n > 3, prove that the least common multiple of the products x

1

x

2

x

k

(k ≥ 1), whose

factors x

i

are the positive integers with

x

1

+x

2

+ x

k

≤n,

is less than n!.

Solution: We claim that the least common multiple of the numbers in question is

¸

p

p prime

p

n/p

.

64 Chapter 6

Consider an arbitrary product x

1

x

2

x

k

, and an arbitrary prime p. Suppose that p

α

j

[x

j

, p

α

j

+1

[x

j

. Clearly p

α

1

+ + pα

k

≤n

and since p

α

≥αp, we have

p(α

1

+ α

k

) ≤n or α

1

+ +α

k

≤

n

p

.

Hence it follows that the exponent of an arbitrary prime p is at most n/p. But on choosing x

1

= = x

k

= p, k =n/p, we

see that there is at least one product for which equality is achieved. This proves the claim.

The assertion of the problem now follows upon applying De Polignac’s Formula and the claim.

Practice

Problem 6.2.1 (AHSME 1977) Find the largest possible n

such that 10

n

divides 1005!.

Problem 6.2.2 Find the highest power of 17 that divides

(17

n

−2)! for a positive integer n.

Problem 6.2.3 Find the exponent of the highest power of 24

that divides 300!.

Problem 6.2.4 Find the largest power of 7 in 300!.

Problem 6.2.5 (AIME 1983) What is the largest two-digit

prime factor of the integer

Ç

200

100

å

?

Problem 6.2.6 (USAMO 1975) 1. Prove that

5x+5y ≥3x +y+3y +x.

2. Using the result of part 1 or otherwise, prove that

(5m)!(5n)!

m!n!(3m+n)!(3n +m)!

is an integer for all positive integers m, n.

Problem 6.2.7 Prove that if n > 1, (n, 6) = 1, then

(2n −4)!

n!(n −2)!

is an integer.

Problem 6.2.8 (AIME 1992) Deﬁne a positive integer n to be

a “factorial tail” if there is some positive integer m such that

the base-ten representation of m! ends with exactly n zeroes.

How many positive integers less than 1992 are not factorial

tails?

Problem 6.2.9 Prove that if m and n are relatively prime pos-

itive integers then

(m+n −1)!

m!n!

is an integer.

Problem 6.2.10 If p is a prime divisor of

Ç

2n

n

å

with p ≥

√

2n

prove that the exponent of p in the factorisation of

Ç

2n

n

å

equals 1.

Problem 6.2.11 Prove that

lcm

ÇÇ

n

1

å

,

Ç

n

2

å

, . . . ,

Ç

n

n

åå

=

lcm(1, 2, . . . , n +1)

n +1

.

Problem 6.2.12 Prove the following result of Catalan:

Ç

m+n

n

å

divides

Ç

2m

m

åÇ

2n

n

å

.

6.3 Complementary Sequences

We deﬁne the spectrum of a real number α to be the inﬁnite multiset of integers

Spec(α) = ¦α, 2α, 3α, . . .¦.

Two sequences Spec(α) and Spec(β) are said to be complementary if they partition the natural numbers, i.e. Spec(α) ∩

Spec(β) = ∅ and Spec(α) ∪Spec(β) =N.

Practice 65

For example, it appears that the two sequences

Spec(

√

2) = ¦1, 2, 4, 5, 7, 8, 9, 11, 12, 14, 15, 16, 18, 19, 21, 22, 24, 25, . . .¦,

and

Spec(2 +

√

2) =¦3, 6, 10, 13, 17, 20, 23, 27, 30, 34, 37, 40, 44, 47, 51, . . .¦

are complementary. The following theorem establishes a criterion for spectra to be complementary.

174 Theorem (Beatty’s Theorem, 1926) If α > 1 is irrational and

1

α

+

1

β

= 1,

then the sequences

Spec(α) and Spec(β)

are complementary.

Proof: Since α > 1, β > 1, Spec(α) and Spec(β) are each sequences of distinct terms, and the total number of

terms not exceeding N taken together in both sequences is N/α+N/β. But N/α −1+N/β −1 <N/α+

[N/β] <N/α+N/β, the last inequality being strict because both α, β are irrational. As 1/α+1/β =1, we gather

that N−2 <N/α+N/β<N. Since the sandwiched quantity is an integer, we deduce [N/α] +[N/β] =N−1.

Thus the total number of terms not exceeding N in Spec(α) and Spec(β) is N−1, as this is true for any N ≥1 each

interval (n, n+1) contains exactly one such term. It follows that Spec(α)∪Spec(β) =N, Spec(α)∩Spec(β) =∅.

u

The converse of Beatty’s Theorem is also true.

175 Theorem (Bang’s Theorem, 1957) If the sequences

Spec(α) and Spec(β)

are complementary, then α, β are positive irrational numbers with

1

α

+

1

β

= 1.

Proof: If both α, β are rational numbers, it is clear that Spec(α), Spec(β) eventually contain the same integers,

and so are not disjoint. Thus α and β must be irrational. If 0 < α ≤ 1, given n there is an M for which

mα −1 < n ≤ mα; hence n = [mα], which implies that Spec(α) = N, whence α > 1 (and so β > 1 also). If

Spec(α) ∩Spec(β) is ﬁnite, then

lim

n→∞

n/α+n/β

n

= 1,

but since (n/α+n/β)

1

n

→1/α +1/β as n →∞, it follows that 1/α +1/β = 1. u

176 Example Suppose we sieve the positive integers as follows: we choose a

1

= 1 and then delete a

1

+1 = 2. The next term

is 3, which we call a

2

, and then we delete a

2

+2 = 5. Thus the next available integer is 4 = a

3

, and we delete a

3

+3 = 7, etc.

Thereby we leave the integers 1, 3, 4, 6, 8, 9, 11, 12, 14, 16, 17, . . .. Find a formula for a

n

.

Solution: What we are asking for is a sequence ¦S

n

¦ which is complementary to the sequence ¦S

n

+n¦. By Beatty’s Theorem,

nτ and nτ+n = n(τ +1) are complementary if 1/τ +1/(τ +1) = 1. But then τ = (1 +

√

5)/2, the Golden ratio. The

n-th term is thus a

n

=nτ.

Practice

66 Chapter 6

Problem 6.3.1 (Skolem) Let τ =

1 +

√

5

2

be the Golden

Ratio. Prove that the three sequences (n ≥ 1)

¦ττn¦, ¦ττ

2

n¦, ¦τ

2

n¦ are complementary.

6.4 Arithmetic Functions

An arithmetic function f is a function whose domain is the set of positive integers and whose range is a subset of the complex

numbers. The following functions are of considerable importance in Number Theory:

d(n) the number of positive divisors of the number n.

σ(n) the sum of the positive divisors of n.

φ(n) the number of positive integers not exceeding

n and relative prime to n.

ω(n) the number of distinct prime divisors of n.

Ω(n) the number of primes dividing n, counting multiplicity.

In symbols the above functions are:

d(n) =

¸

d[n

1, σ(n) =

¸

d[n

d, ω(n) =

¸

p[n

1, Ω(n) =

¸

p

α

[[n

α,

and

φ(n) =

¸

1≤k≤n

(k,n)=1

1.

(The symbol [[ in p

α

[[n is read exactly divides and it signiﬁes that p

α

[n but p

α+1

[n.)

For example, since 1, 2, 4, 5, 10 and 20 are the divisors of 20, we have d(20) =6, σ(20) =42, ω(20) =2, Ω(20) =3. Since

the numbers 1, 3, 7, 9, 11, 13, 17, 19 are the positive integers not exceeding 20 and relatively prime to 20, we see that φ(20) =8.

If f is an arithmetic function which is not identically 0 such that f (mn) = f (m) f (n) for every pair of relatively prime natural

numbers m, n, we say that f is then a multiplicative function. If f (mn) = f (m) f (n) for every pair of natural numbers m, n we

say then that f is totally multiplicative.

Let f be multiplicative and let n have the prime factorisation n = p

a

1

1

p

a

2

2

p

a

r

r

. Then

f (n) = f (p

a

1

1

) f (p

a

2

2

) f (p

a

r

r

).

A multiplicative function is thus determined by its values at prime powers. If f is multiplicative, then there is a positive integer

a such that f (a) = 0. Hence f (a) = f (1 a) = f (1) f (a) which entails that f (1) = 1.

We will now show that the functions d and σ are multiplicative. For this we need ﬁrst the following result.

177 Theorem Let f be a multiplicative function and let F(n) =

¸

d[n

f (d). Then F is also multiplicative.

Proof: Suppose that a, b are natural numbers with (a, b) = 1. By the Fundamental Theorem of Arithmetic, every

divisor d of ab has the form d = d

1

d

2

where d

1

[a, d

2

[b, (d

1

, d

2

) = 1. Thus there is a one-to-one correspondence

between positive divisors d of ab and pairs d

1

, d

2

of positive divisors of a and b. Hence, if n = ab, (a, b) = 1 then

F(n) =

¸

d[n

f (d) =

¸

d

1

[a

¸

d

2

[b

f (d

1

d

2

).

Since f is multiplicative the dextral side of the above equals

¸

d

1

[a

¸

d

2

[b

f (d

1

) f (d

2

) =

¸

d

1

[a

f (d

1

)

¸

d

2

[b

f (d

2

) = F(a)F(b).

This completes the proof. u

Arithmetic Functions 67

Since the function f (n) = 1 for all natural numbers n is clearly multiplicative (indeed, totally multiplicative), the theorem

above shows that d(n) =

¸

d[n

1 is a multiplicative function. If p is a prime, the divisors of p

a

are 1, p, p

2

, p

3

, . . . , p

a

and so

d(p

a

) = a +1. This entails that if n has the prime factorisation n = p

a

1

1

p

a

2

2

p

a

r

r

, then

d(n) = (1 +a

1

)(1 +a

2

) (1 +a

r

).

For example, d(2904) = d(2

3

3 11

2

) = d(2

3

)d(3)d(11

2

) = (1 +3)(1 +1)(1 +2) = 24.

We give now some examples pertaining to the divisor function.

178 Example (AHSME 1993) For how many values of n will an n-sided polygon have interior angles with integral degree

measures?

Solution: The measure of an interior angle of a regular n-sided polygon is

(n −2)180

n

. It follows that n must divide 180. Since

there are 18 divisors of 180, the answer is 16, because n ≥3 and so we must exclude the divisors 1 and 2.

179 Example Prove that d(n) ≤2

√

n.

Solution: Each positive divisor a of n can paired with its complementary divisor

n

a

. As n = a

n

a

, one of these divisors must be

≤

√

n. This gives at most 2

√

n divisors.

180 Example Find all positive integers n such that d(n) = 6.

Solution: Since 6 can be factored as 2 3 and 6 1, the desired n must have only two distinct prime factors, p and q, say. Thus

n = p

α

q

β

and either 1 +α = 2, 1 +β = 3 or 1 +α = 6, 1 +β = 1. Hence, n must be of one of the forms pq

2

or p

5

, where p, q

are distinct primes.

181 Example Prove that

n

¸

k=1

d(k) =

n

¸

j=1

n

j

Solution: We have

n

¸

k=1

d(k) =

n

¸

k=1

¸

j[k

1.

Interchanging the order of summation

¸

j≤n

¸

j≤k≤n

k≡0 mod j

1 =

¸

j≤n

n

j

,

which is what we wanted to prove.

182 Example (Putnam 1967) A certain locker room contains n lockers numbered 1, 2, . . . , n and are originally locked. An

attendant performs a sequence of operations T

1

, T

2

, . . . , T

n

whereby with the operation T

k

, 1 ≤ k ≤ n, the condition of being

locked or unlocked is changed for all those lockers and only those lockers whose numbers are multiples of k. After all the n

operations have been performed it is observed that all lockers whose numbers are perfect squares (and only those lockers) are

now open or unlocked. Prove this mathematically.

Solution: Observe that locker m, 1 ≤m ≤n, will be unlocked after n operations if and only if m has an odd number of divisors.

Now, d(m) is odd if and only if m is a perfect square. The assertion is proved.

68 Chapter 6

Since the function f (n) = n is multiplicative (indeed, totally multiplicative), the above theorem entails that σ is multiplica-

tive. If p is a prime, then clearly σ(p

a

) =1+p+p

2

+ +p

a

. This entails that if n has the prime factorisation n = p

a

1

1

p

a

2

2

p

a

r

r

,

then

σ(n) = (1 + p

1

+ p

2

1

+ + p

a

1

1

)(1 + p

2

+ p

2

2

+ + p

a

2

w

) (1 + p

r

+ p

2

r

+ + p

a

r

r

).

This last product also equals

p

a

1

+1

1

−1

p

1

−1

p

a

2

+1

2

−1

p

2

−1

p

a

r

+1

r

−1

p

r

−1

.

We present now some examples related to the function σ.

183 Example (Putnam 1969) Let n be a positive integer such that 24[n +1. Prove that the sum of all divisors of n is also

divisible by 24.

Solution: Since 24[n+1, n ≡1 or 2 mod 3 and d ≡1, 3, 5 or 7 mod 8. As d(

n

d

) ≡−1 mod 3 or mod 8, the only possibilities

are

d ≡1, n/d ≡2 mod 3 or vice versa,

d ≡1, n/d ≡7 mod 8 or vice versa,

d ≡3, n/d ≡5 mod 8 or vice versa.

In all cases d +n/d ≡ 0 mod 3 and mod 8, whence 24 divides d +n/d. As d ≡ n/d, no divisor is used twice in the pairing.

This implies that 24[

¸

d[n

d.

We say that a natural number is perfect if it is the sum of its proper divisors. For example, 6 is perfect because 6 =

¸

d[6,d=6

d =

1 +2 +3. It is easy to see that a natural number is perfect if and only if 2n =

¸

d[n

d. The following theorem is classical.

184 Theorem An even number is perfect if and only if it is of the form 2

p−1

(2

p

−1) where both p and 2

p

−1 are primes.

Proof: Suppose that p, 2

p

−1 are primes. Then σ(2

p

−1) = 1 +2

p

−1. Since (2

p−1

, 2

p

−1) = 1, σ(2

p−1

(2

p

−

1)) = σ(2

p−1

)σ(2

p

−1) = (1 +2 +2

2

+ +2

p−1

)(1 +2

p

−1) = (2

p

−1)2(2

p−1

), and 2

p−1

(2

p

−1) is perfect.

Conversely, let n be an even perfect number. Write n = 2

s

m, m odd. Then σ(n) = σ(2

s

)σ(m) = (2

s+1

−1)σ(m).

Also, since n perfect is, σ(n) = 2n = 2

s+1

m. Hence (2

s+1

−1)σ(m) = 2

s+1

m. One deduces that 2

s+1

[σ(m), and

so σ(m) = 2

s+1

b for some natural number b. But then (2

s+1

−1)b = m, and so b[m, b = m.

We propose to show that b = 1. Observe that b +m = (2

s+1

−1)b +b = 2

s+1

b = σ(m). If b = 1, then there are at

least three divisors of m, namely 1, b and m, which yields σ(m) ≥ 1 +b +m, a contradiction. Thus b = 1, and so

m = (2

s+1

−1)b = 2

s+1

−1 is a prime. This means that 2

s+1

−1 is a Mersenne prime and hence s +1 must be a

prime.u

185 Example Prove that for every natural number n there exist natural numbers x and y such that x−y ≥n and σ(x

2

) =σ(y

2

).

Solution: Let s ≥n, (s, 10) = 1. We take x = 5s, y = 4s. Then σ(x

2

) = σ(y

2

) = 31σ(s

2

).

Practice

Euler’s Function. Reduced Residues 69

Problem 6.4.1 Find the numerical values of d(1024), σ(1024), ω(1024),

Ω(1024) and φ(1024).

Problem 6.4.2 Describe all natural numbers n such that

d(n) = 10.

Problem 6.4.3 Prove that

d(2

n

−1) ≥d(n).

Problem 6.4.4 Prove that d(n) ≤

√

3n with equality if and

only if n = 12.

Problem 6.4.5 Prove that the following Lambert expansion

holds:

∞

¸

n=1

d(n)t

n

=

∞

¸

n=1

t

n

1 −t

n

.

Problem 6.4.6 Let d

1

(n) = d(n), d

k

(n) = d(d

k−1

(n)), k =

2, 3, . . .. Describe d

k

(n) for sufﬁciently large k.

Problem 6.4.7 Let m ∈ N be given. Prove that the set

A =¦n ∈ N : m[d(n)¦

contains an inﬁnite arithmetic progression.

Problem 6.4.8 Let n be a perfect number. Show that

¸

d[n

1

d

= 2.

Problem 6.4.9 Prove that

¸

d[n

d = n

d(n)/2

.

Problem 6.4.10 Prove that the power of a prime cannot be a

perfect number.

Problem 6.4.11 (AIME, 1995) Let n = 2

31

3

19

. How many

positive integer divisors of n

2

are less than n but do not di-

vide n?

Problem 6.4.12 Prove that if n is composite, then σ(n) >

n +

√

n.

Problem 6.4.13 Prove that σ(n) =n+k, k >1 a ﬁxed natural

number has only ﬁnitely many solutions.

Problem 6.4.14 Characterise all n for which σ(n) is odd.

Problem 6.4.15 Prove that p is a prime if and only if σ(p) =

1 + p.

Problem 6.4.16 Prove that

σ(n!)

n!

≥1 +

1

2

+ +

1

n

.

Problem 6.4.17 Prove that an odd perfect number must have

at least two distinct prime factors.

Problem 6.4.18 Prove that in an odd perfect number, only one

of its prime factors occurs to an odd power; all the others oc-

cur to an even power.

Problem 6.4.19 Show that an odd perfect number must con-

tain one prime factor p such that, if the highest power of p

occurring in n is p

a

, both p and a are congruent to 1 modulo

4; all other prime factors must occur to an even power.

Problem 6.4.20 Prove that every odd perfect number having

three distinct prime factors must have two of its prime factors

3 and 5.

Problem 6.4.21 Prove that there do not exist odd perfect num-

bers having exactly three distinct prime factors.

Problem 6.4.22 Prove that

n

¸

k=1

σ(k) =

n

¸

j=1

j

n

j

.

Problem 6.4.23 Find the number of sets of positive integers

¦a, b, c¦ such that a b c = 462.

6.5 Euler’s Function. Reduced Residues

Recall that Euler’s φ(n) function counts the number of positive integers a ≤n that are relatively prime to n. We will prove now

that φ is multiplicative. This requires more work than that done for d and σ.

First we need the following deﬁnitions.

70 Chapter 6

186 Deﬁnition Let n > 1. The φ(n) integers 1 = a

1

< a

2

< < a

φ(n)

= n −1 less than n and relatively prime to n are called

the canonical reduced residues modulo n.

187 Deﬁnition A reduced residue system modulo n, n > 1 is a set of φ(n) incongruent integers modulo n that are relatively

prime to n.

For example, the canonical reduced residues mod 12 are 1, 5, 7, 11 and the set ¦−11, 5, 19, 23¦ forms a reduced residue

system modulo 12.

We are now ready to prove the main result of this section.

188 Theorem The function φ is multiplicative.

Proof: Let n be a natural number with n = ab, (a, b) = 1. We arrange the ab integers 1, 2, . . . , ab as follows.

1 2 3 . . . k . . . a

a +1 a +2 a +3 . . . a +k . . . 2a

2a +1 2a +2 2a +3 . . . 2a +k . . . 3a

. . . . . . . . . . . . . . . . . . . . .

(b −1)a +1 (b −1)a +2 (b −1)a +3 . . . (b −1)a +k . . . ba

Now, an integer r is relatively prime to m if and only if it is relatively prime to a and b. We shall determine ﬁrst the

number of integers in the above array that are relatively prime to a and ﬁnd out how may of them are also relatively

prime to b.

There are φ(a) integers relatively prime to a in the ﬁrst row. Now consider the k-th column, 1 ≤k ≤a. Each integer

on this column is of the form ma +k, 0 ≤m ≤ b −1. As k ≡ ma +k mod a, k will have a common factor with a if

and only if ma +k does. This means that there are exactly φ(a) columns of integers that are relatively prime to a.

We must determine how many of these integers are relatively prime to b.

We claim that no two integers k, a +k, . . . , (b −1)a +k on the k-th column are congruent modulo b. For if ia +k ≡

ja +k mod b then a(i − j) ≡0 mod b. Since (a, b) = 1, we deduce that i − j ≡0 mod b thanks to Corollary ??.

Now i, j ∈ [0, b −1] which implies that [i − j[ < b. This forces i = j. This means that the b integers in any of these

φ(n) columns are, in some order, congruent to the integers 0, 1, . . . , b −1. But exactly φ(b) of these are relatively

prime to b. This means that exactly φ(a)φ(b) integers on the array are relatively prime to ab, which is what we

wanted to show.u

If p is a prime and m a natural number, the integers

p, 2p, 3p, . . . , p

m−1

p

are the only positive integers ≤ p

m

sharing any prime factors with p

m

. Thus φ(p

m

) = p

m

− p

m−1

. Since φ is multiplicative, if

n = p

a

1

1

p

a

k

k

is the factorisation of n into distinct primes, then

φ(n) = (p

a

1

1

− p

a

1

−1

1

) (p

a

k

k

− p

a

k

−1

k

).

For example, φ(48) = φ(2

4

3) = φ(2

4

)φ(3) = (2

4

−2

3

)(3 −1) = 16, and φ(550) = φ(2 5

2

11) = φ(2) φ(5

2

) φ(11) =

(2 −1)(5

2

−5)(11 −1) = 1 20 10 = 200.

189 Example Let n be a natural number. How many of the fractions 1/n, 2/n, . . . , (n −1)/n, n/n are irreducible?

Solution: This number is clearly

n

¸

k=1

φ(k).

Euler’s Function. Reduced Residues 71

190 Example Prove that for n > 1,

¸

1≤a≤n

(a,n)=1

a =

nφ(n)

2

.

Solution: Clearly if 1 ≤a ≤n and (a, n) = 1, 1 ≤n −a ≤n and (n −a, n) = 1. Thus

S =

¸

1≤a≤n

(a,n)=1

a =

¸

1≤a≤n

(a,n)=1

n −a,

whence

2S =

¸

1≤a≤n

(a,n)=1

n = nφ(n).

The assertion follows.

191 Theorem Let n be a positive integer. Then

¸

d[n

φ(d) = n.

Proof: For each divisor d of n, let T

d

(n) be the set of positive integers ≤ n whose gcd with n is d. As d varies

over the divisors of n, the T

d

partition the set ¦1, 2, . . . , n¦ and so

¸

d[n

T

d

(n) = n.

We claim that T

d

(n) has φ(n/d) elements. Note that the elements of T

d

(n) are found amongst the integers

d, 2d, . . .

n

d

d. If k ∈T

d

(n), then k =ad, 1 ≤a ≤n/d and (k, n) =d. But then (

k

d

,

n

d

) =1. This implies that (a,

n

d

) =1.

Therefore counting the elements of T

d

(n) is the same as counting the integers a with 1 ≤ a ≤ n/d, (a,

n

d

) = 1. But

there are exactly φ(n/d) such a. We gather that

n =

¸

d[n

φ(n/d).

But as d runs through the divisors of n, n/d runs through the divisors of n in reverse order, whence n =

¸

d[n

φ(n/d) =

¸

d[n

φ(d).u

192 Example If p −1 and p +1 are twin primes, and p > 4, prove that 3φ(p) ≤ p.

Solution: Observe that p > 4 must be a multiple of 6, so

p = 2

a

3

b

m, ab ≥1, (m, 6) = 1.

We then have φ(p) ≤2

a

3

b−1

φ(m) ≤2

a

3

b−1

m = p/3.

193 Example Let n ∈ N. Prove that the equation

φ(x) = n!

is soluble.

72 Chapter 6

Solution: We want to solve the equation φ(x) = n with the constraint that x has precisely the same prime factors as n. This

restriction implies that φ(x)/x = φ(n)/n. It follows that x = n

2

/φ(n).

Let n =

¸

p

α

[[n

p

α

. Then x =

¸

p

α

[[n

p

α

p −1

. The integer x will have the same prime factors as n provided that

¸

p[n

(p −1)[n. It is

clear then that a necessary and sufﬁcient condition for φ(x) = n to be soluble under the restriction that x has precisely the same

prime factors as n is

¸

p[n

(p −1)[n. If n = k!, this last condition is clearly satisﬁed. An explicit solution to the problem is thus

x = (k!)

2

/φ(k!).

194 Example Let φ

k

(n) =φ(φ

k−1

(n)), k = 1, 2, . . . , where φ

0

(n) =φ(n). Show that ∀k ∈ N, φ

k

(n) >1 for all sufﬁciently large

n.

Solution: Let p

a

1

1

p

a

2

2

p

a

r

r

be the prime factorisation of n. Clearly

p

a

1

/2

1

p

a

2

/2

2

p

a

r

/2

r

> 2

r−1

≥

1

2

p

1

p

1

−1

p

r

p

r

−1

.

Hence

φ(n) =

p

1

−1

p

1

p

2

−1

p

2

p

r

−1

p

r

p

a

1

1

p

a

2

2

p

a

r

r

≥

1

2

p

a

1

1

p

a

2

2

p

a

r

r

p

a

1

/2

1

p

a

2

/2

2

p

a

r

/2

r

.

This last quantity equals

√

n/2. Therefore φ

1

(n) >

1

2

»

φ(n) >

1

2

…

1

4

√

n =

1

4

n

1/4

. In general we can show that φ

k

(n) >

1

4

n

2

−k−1

. We conclude that n ≥2

2

k+2

implies that φ

k

(n) > 1.

195 Example Find inﬁnitely many integers n such that 10[φ(n).

Solution: Take n = 11

k

, k = 1, 2, . . .. Then φ(11

k

) = 11

k

−11

k−1

= 10 11

k−1

.

Practice

Problem 6.5.1 Prove that

φ(n) = n

¸

p[n

Å

1 −

1

p

ã

.

Problem 6.5.2 Prove that if n is composite then φ(n) ≤ n −

√

n. When is equality achieved?

Problem 6.5.3 (AIME 1992) Find the sum of all positive ra-

tional numbers that are less than 10 and have denominator 30

when written in lowest terms.

Answer: 400

Problem 6.5.4 Prove that φ(n) ≥n2

−ω(n)

.

Problem 6.5.5 Prove that φ(n) >

√

n for n > 6.

Problem 6.5.6 If φ(n)[n, then n must be of the form 2

a

3

b

for

nonnegative integers a, b.

Problem 6.5.7 Prove that if φ(n)[n − 1, then n must be

squarefree.

Problem 6.5.8 (Mandelbrot 1994) Four hundred people are

standing in a circle. You tag one person, then skip k people,

then tag another, skip k, and so on, continuing until you tag

someone for the second time. For how many positive values

of k less than 400 will every person in the circle get tagged at

least once?

Problem 6.5.9 Prove that if φ(n)[n −1 and n is composite,

then n has at least three distinct prime factors.

Problem 6.5.10 Prove that if φ(n)[n −1 and n is composite,

then n has at least four prime factors.

Multiplication in Z

n

73

Problem 6.5.11 For n > 1 let 1 = a

1

< a

2

< < a

φ(n)

=

n −1 be the positive integers less than n that are relatively

prime to n. Deﬁne the Jacobsthal function

g(n) := max

1≤k≤φ(n)−1

a

k+1

−a

k

to be the maximum gap between the a

k

. Prove that ω(n) ≤

g(n).

(Hint: Use the Chinese Remainder Theorem).

Problem 6.5.12 Prove that a necessary and sufﬁcient condi-

tion for n to be a prime is that

σ(n) +φ(n) = nd(n).

6.6 Multiplication in Z

n

In section 3.5 we saw that Z

n

endowed with the operation of addition +

n

becomes a group. We are now going to investigate the

multiplicative structure of Z

n

.

How to deﬁne multiplication in Z

n

? If we want to multiply a

n

b we simply multiply a b and reduce the result mod n. As

an example, let us consider Table ??. To obtain 4

6

2 we ﬁrst multiplied 4 2 = 8 and then reduced mod 6 obtaining 8 ≡ 2

mod 6. The answer is thus 4

6

2 = 2.

Another look at the table shows the interesting product 3

6

2 = 0. Why is it interesting? We have multiplied to non-zero

entities and obtained a zero entity!

Does Z

6

form a group under

6

? What is the multiplicative identity? In analogy with the rational numbers, we would like

1 to be the multiplicative identity. We would then deﬁne the multiplicative inverse of a to be that b that has the property that

a

6

b = b

6

a = 1. But then, we encounter some problems. For example, we see that 0, 2, 3, and 4 do not have a multiplicative

inverse. We need to be able to identify the invertible elements of Z

n

. For that we need the following.

6

0 1 2 3 4 5

0 0 0 0 0 0 0

1 0 1 2 3 4 5

2 0 2 4 0 2 4

3 0 3 0 3 0 3

4 0 4 2 0 4 2

5 0 5 4 3 2 1

Table 6.1: Multiplication Table for Z

6

196 Deﬁnition Let n > 1 be a natural number. An integer b is said to be the inverse of an integer a modulo n if ab ≡1 mod n.

It is easy to see that inverses are unique mod n. For if x, y are inverses to a mod n then ax ≡1 mod n and ay ≡1 mod n.

Multiplying by y the ﬁrst of these congruences, (ya)x ≡y mod n. Hence x ≡y mod n.

197 Theorem Let n > 1, a be integers. Then a possesses an inverse modulo n if and only if a is relatively prime to n.

Proof: Assume that b is the inverse of a mod n. Then ab ≡1 mod n, which entails the existence of an integer s

such that ab −1 = sn, i.e. ab −sn = 1. This is a linear combination of a and n and hence divisible by (a, n). This

implies that (a, n) = 1.

Conversely if (a, n) = 1, by the Bachet-Bezout Theorem there are integers x, y such that ax +ny = 1. This immedi-

ately yields ax ≡1 mod n, i.e., a has an inverse mod n.u

198 Example Find the inverse of 5 mod 7.

Solution: We are looking for a solution to the congruence 5x ≡1 mod 7. By inspection we see that this is x ≡3 mod 7.

74 Chapter 6

According to the preceding theorem, a will have a multiplicative inverse if and only if (a, n) = 1. We thus see that only the

reduced residues mod n have an inverse. We let Z

n

= ¦a

1

, a

2

, . . . , a

φ(n)

¦. It is easy to see that the operation

n

is associative,

since it inherits associativity from the integers. We conclude that Z

n

is a group under the operation

n

.

We now give some assorted examples.

199 Example (IMO 1964) Prove that there is no positive integer n for which 2

n

+1 is divisible by 7.

Solution: Observe that 2

1

≡ 2, 2

2

≡ 4, 2

3

≡ 1 mod 7, 2

4

≡ 2 mod 7, 2

5

≡ 4 mod 7, 2

6

≡ 1 mod 7, etc. The pattern 2, 4, 1,

repeats thus cyclically. This says that there is no power of 2 which is ≡−1 ≡6 mod 7.

200 Theorem If a is relatively prime to the positive integer n, there exists a positive integer k ≤n such that a

k

≡1 mod n.

Proof: Since (a, n) = 1 we must have (a

j

, n) = 1 for all j ≥1. Consider the sequence a, a

2

, a

3

, . . . , a

n+1

mod n.

As there are n +1 numbers and only n residues mod n, the Pigeonhole Principle two of these powers must have

the same remainder mod n. That is, we can ﬁnd s, t with 1 ≤ s < t ≤ n +1 such that a

s

≡ a

t

mod n. Now,

1 ≤ t −s ≤ n. Hence a

s

≡ a

t

mod n gives a

t−s

a

s

≡ a

t−s

a

t

mod n, which is to say a

t

≡ a

t−s

a

t

mod n. Using

Corollary ?? we gather that a

t−s

≡1 mod n, which proves the result.u

If (a, n) = 1, the preceding theorem tells us that there is a positive integer k with a

k

≡ 1 mod n. By the Well-Ordering

Principle, there must be a smallest positive integer with this property. This prompts the following deﬁnition.

201 Deﬁnition If m is the least positive integer with the property that a

m

≡1 mod n, we say that a has order m mod n.

For example, 3

1

≡ 3, 3

2

≡ 2, 3

3

≡ 6, 3

4

≡ 4, 3

5

≡ 5, 3

6

≡1 mod 7, and so the order of 3 mod 7 is 6. We write this fact as

ord

7

3 = 6.

Given n, not all integers a are going to have an order mod n. This is clear if n[a, because then a

m

≡ 0 mod n for all

positive integers m. The question as to which integers are going to have an order mod n is answered in the following theorem.

202 Theorem Let n > 1 be a positive integer. Then a ∈ Z has an order mod n if and only if (a, n) = 1.

Proof: If (a, n) = 1, then a has an order in view of Theorem ?? and the Well-Ordering Principle. Hence assume

that a has an order mod n. Clearly a = 0. The existence of an order entails the existence of a positive integer

m such that a

m

≡ 1 mod n. Hence, there is an integer s with a

m

+sn = 1 or a a

m−1

+sn = 1. This is a linear

combination of a and n and hence divisible by (a, n). This entails that (a, n) = 1. u

The following theorem is of utmost importance.

203 Theorem Let (a, n) = 1 and let t be an integer. Then a

t

≡1 mod n if and only if ord

n

a[t.

Proof: Assume that ord

n

a[t. Then there is an integer s such that sord

n

a =t. This gives

a

t

≡a

sord

n

a

≡(a

ord

n

a

)

s

≡1

s

≡1 mod n.

Conversely, assume that a

t

≡1 mod n and t = x ord

n

a +y, 0 ≤y < ord

n

a. Then

a

y

≡a

t−xord

n

a

≡a

t

(a

ord

n

a

)

−x

≡1 1

−x

≡1 mod n.

If y > 0 we would have a positive integer smaller than ord

n

a with the property a

y

≡ 1 mod n. This contradicts

the deﬁnition of ord

n

a as the smallest positive integer with that property. Hence y = 0 and thus t = x ord

n

a, i.e.,

ord

n

a[t.u

Practice 75

204 Example (IMO 1964) Find all positive integers n for which 2

n

−1 is divisible by 7.

Solution: Observe that the order of 2 mod 7 is 3. We want 2

n

≡ 1 mod 7. It must then be the case that 3[n. Thus n =

3, 6, 9, 12, . . ..

The following result will be used repeatedly.

205 Theorem Let n > 1, a ∈ Z, (a, n) = 1. If r

1

, r

2

, . . . , r

φ(n)

is a reduced set of residues modulo n, then ar

1

, ar

2

, . . . , ar

φ(n)

is

also a reduced set of residues modulo n.

Proof: We just need to showthat the φ(n) numbers ar

1

, ar

2

, . . . , ar

φ(n)

are mutually incongruent mod n. Suppose

that ar

i

≡ ar

j

mod n for some i = j. Since (a, n) = 1, we deduce from Corollary ?? that r

i

≡ r

j

mod n. This

contradicts the fact that the r’s are incongruent, so the theorem follows.u

For example, as 1, 5, 7, 11 is a reduced residue system modulo 12 and (12, 5) = 1, the set 5, 25, 35, 55 is also a reduced

residue system modulo 12. Again, the 1, 5, 7, 11 are the 5, 25, 35, 55 in some order and 1 5 7 11 ≡5 25 35 55 mod 12.

The following corollary to Theorem ?? should be immediate.

206 Corollary Let n > 1, a, b ∈ Z, (a, n) = 1. If r

1

, r

2

, . . . , r

φ(n)

is a reduced set of residues modulo n, then ar

1

+b, ar

2

+

b, . . . , ar

φ(n)

+b is also a reduced set of residues modulo n.

Practice

Problem 6.6.1 Find the order of 5 modulo 12.

6.7 Möbius Function

207 Deﬁnition The Möbius function is deﬁned for positive integer n as follows:

µ(n) =

1 if n = 1,

(−1)

ω(n)

if ω(n) = Ω(n),

0 if ω(n) < Ω(n).

Thus µ is 1 for n = 1 and square free integers with an even number of prime factors, −1 for square free integers with an

odd number of prime factors, and 0 for non-square free integers. Thus for example µ(6) = 1, µ(30) = −1 and µ(18) = 0.

208 Theorem The Möbius Function µ is multiplicative.

Proof: Assume (m, n) = 1. If both M and n are square-free then

µ(m)µ(n) = (−1)

ω(m)

(−1)

ω(n)

= (−1)

ω(m)+ω(n)

= µ(mn).

If one of m, n is not square-free then

µ(m)µ(n) = 0 = µ(mn).

This proves the theorem. u

209 Theorem

¸

d[n

µ(d) =

ß

1 if n = 1,

0 if n > 1.

76 Chapter 6

Proof: There are

Ç

ω(n)

k

å

square-free divisors d of n with exactly k prime factors. For all such d, µ(d) = (−1)

k

.

The sum in question is thus

¸

d[n

µ(d) =

ω(n)

¸

k=0

Ç

ω(n)

k

å

(−1)

k

.

By the Binomial Theorem this last sum is (1 −1)

ω(n)

= 0.u

210 Theorem (Möbius Inversion Formula) Let f be an arithmetical function and F(n) =

¸

d[n

f (d). Then

f (n) =

¸

d[n

µ(d)F(n/d) =

¸

d[n

µ(n/d)F(d).

Proof: We have

¸

d[n

µ(d)F(n/d) =

¸

d[n

¸

d[n

¸

s[

n

d

f (s)

=

¸

ds[n

µ(d) f (s)

=

¸

s[n

f (s)

¸

d[

n

s

µ(d).

In view of theorem ??, the inner sum is different from 0 only when

n

s

= 1. Hence only the term s = n in the outer

sum survives, which means that the above sums simplify to f (n).u

We now show the converse to Theorem ??.

211 Theorem Let f , F be arithmetic functions with f (n) =

¸

d[n

µ(d)F(n/d) for all natural numbers n. Then F(n) =

¸

d[n

f (d).

Proof: We have

¸

d[n

f (d) =

¸

d[n

¸

s[d

µ(s)F(d/s)

=

¸

d[n

¸

s[d

µ(d/s)F(s)

=

¸

s[n

¸

r[

n

s

µ(r)F(s).

Using Theorem ??, the inner sum will be 0 unless s = n, in which case the entire sum reduces to F(n).u

Practice

Problem 6.7.1 Prove that

φ(n) = n

¸

d[n

µ(d)

d

.

Problem 6.7.2 If f is an arithmetical function and F(n) =

Practice 77

n

¸

k=1

f ([n/k]), then

f (n) =

n

¸

j=1

µ( j)F([n/ j]).

Problem 6.7.3 If F is an arithmetical function such that

f (n) =

n

¸

k=1

µ(k)F([n/k]), prove that F(n) =

n

¸

j=1

f ( j).

Problem 6.7.4 Prove that

¸

d[n

[µ(d)[ = 2

ω(n)

.

Problem 6.7.5 Prove that

¸

d[n

µ(d)d(d) = (−1)

ω(n)

.

Problem 6.7.6 Given any positive integer k, prove that there

exist inﬁnitely many integers n with

µ(n +1) = µ(n +2) = = µ(n +k).

Chapter 7

More on Congruences

7.1 Theorems of Fermat and Wilson

212 Theorem (Fermat’s Little Theorem) Let p be a prime and let p [a. Then

a

p−1

≡1 mod p.

Proof: Since (a, p) = 1, the set a 1, a 2, . . . , a (p −1) is also a reduced set of residues mod p in view of

Theorem ??. Hence

(a 1)(a 2) (a (p −1)) ≡1 2 (p −1) mod p,

or

a

p−1

(p −1)! ≡(p −1)! mod p.

As ((p −1)!, p) = 1 we may cancel out the (p −1)!’s in view of Corollary ??. This proves the theorem.u

As an obvious corollary, we obtain the following.

213 Corollary For every prime p and for every integer a,

a

p

≡a mod p.

Proof: Either p[a or p [a. If p[a, a ≡ 0 ≡ a

p

mod p and there is nothing to prove. If p [a, Fermat’s Little

Theorem yields p[a

p−1

−1. Hence p[a(a

p−1

−1) = a

p

−a, which again gives the result.u

The following corollary will also be useful.

214 Corollary Let p be a prime and a an integer. Assume that p [a. Then ord

p

a[p −1.

Proof: This follows immediately from Theorem ?? and Fermat’s Little Theorem.u

215 Example Find the order of 8 mod 11.

Solution: By Corollary ?? ord

11

8 is either 1, 2, 5 or 10. Now 8

2

≡ −2 mod 11, 8

4

≡ 4 mod 11 and 8

5

≡ −1 mod 11. The

order is thus ord

11

8 = 10.

216 Example Let a

1

= 4, a

n

= 4

a

n−1

, n > 1. Find the remainder when a

100

is divided by 7.

78

Theorems of Fermat and Wilson 79

Solution: By Fermat’s Little Theorem, 4

6

≡1 mod 7. Now, 4

n

≡4 mod 6 for all positive integers n, i.e., 4

n

= 4+6t for some

integer t. Thus

a

100

≡4

a

99

≡4

4+6t

≡4

4

(4

6

)

t

≡4 mod 7.

217 Example Prove that for m, n ∈ Z, mn(m

60

−n

60

) is always divisible by 56786730.

Solution: Let a = 56786730 = 2 3 5 7 11 13 31 61. Let Q(x, y) = xy(x

60

−y

60

). Observe that (x −y)[Q(x, y), (x

2

−

y

2

)[Q(x, y), (x

3

−y

3

)[Q(x, y), (x

4

−y

4

)[Q(x, y), (x

6

−y

6

)[Q(x, y), (x

10

−y

10

)[Q(x, y), (x

12

−y

12

)[Q(x, y), and (x

30

−y

30

)[Q(x, y).

If p is any one of the primes dividing a, the Corollary to Fermat’s Little Theorem yields m

p

−m ≡ 0 mod p and n

p

−

n ≡ 0 mod p. Thus n(m

p

−m) −m(n

p

−n) ≡ 0 mod p, i.e., mn(m

p−1

−n

p−1

) ≡ 0 mod p. Hence, we have 2[mn(m−

n)[Q(m, n), 3[mn(m

2

−n

2

)[Q(m, n), 5[mn(m

4

−n

4

)[Q(m, n), 7[mn(m

6

−n

6

)[Q(m, n), 11[mn(m

10

−n

10

)[Q(m, n), 13[mn(m

12

−n

12

)[Q(m, n), 31[mn

n

30

)[Q(m, n) and 61[mn(m

60

−n

60

)[Q(m, n). Since these are all distinct primes, we gather that a[mnQ(m, n), which is what we

wanted.

218 Example (Putnam 1972) Showthat given an odd prime p, there are always inﬁnitely many integers n for which p[n2

n

+1.

Answer: For any odd prime p, take n = (p −1)

2k+1

, k = 0, 1, 2, . . .. Then

n2

n

+1 ≡(p −1)

2k+1

(2

p−1

)

(p−1)

2k

+1 ≡(−1)

2k+1

1

2k

+1 ≡0 mod p.

219 Example Prove that there are no integers n > 1 with n[2

n

−1.

Solution: If n[2

n

−1 for some n > 1, then n must be odd and have a smallest odd prime p as a divisor. By Fermat’s Little

Theorem, 2

p−1

≡1 mod p. By Corollary ?? , ord

p

2 has a prime factor in common with p −1. Now, p[n[2

n

−1 and so 2

n

≡1

mod p. Again, by Corollary ??, ord

p

2 must have a common prime factor with n (clearly ord

p

2 > 1). This means that n has a

smaller prime factor than p, a contradiction.

220 Example Let p be a prime. Prove that

1.

Ç

p −1

n

å

≡(−1)

n

mod p, 1 ≤n ≤ p −1.

2.

Ç

p +1

n

å

≡0 mod p, 2 ≤n ≤ p −1.

3. If p = 5 is an odd prime, prove that either f

p−1

or f

p+1

is divisible by p.

Solution: (1) (p −1)(p −2) (p −n) ≡(−1)(−2) (−n) ≡(−1)

n

n! mod p. The assertion follows from this.

(2) (p +1)(p)(p −1) (p −n +2) ≡(1)(0)(−1) (−n +2) ≡0 mod p. The assertion follows from this.

(3) Using the Binomial Theorem and Binet’s Formula

f

n

=

1

2

n−1

ÇÇ

n

1

å

+5

Ç

n

3

å

+5

2

Ç

n

5

å

+

å

.

From this and (1),

2

p−2

f

p−1

≡ p −1 − (5 +5

2

+ +5

(p−3)/2

) ≡−

5

(p−1)/2

−1

4

mod p.

80 Chapter 7

Using (2),

2

p

f

p+1

≡ p +1 +5

(p−1)/2

≡5

(p−1)/2

+1 mod p.

Thus

2

p

f

p−1

f

p+1

≡5

p−1

−1 mod p.

But by Fermat’s Little Theorem, 5

p−1

≡1 mod p for p = 5. The assertion follows.

221 Lemma If a

2

≡1 mod p, then either a ≡1 mod p or a ≡−1 mod p.

Proof: We have p[a

2

−1 = (a −1)(a +1). Since p is a prime, it must divide at least one of the factors. This

proves the lemma.u

222 Theorem (Wilson’s Theorem) If p is a prime, then (p −1)! ≡−1 mod p.

Proof: If p =2 or p =3, the result follows by direct veriﬁcation. So assume that p >3. Consider a, 2 ≤a ≤ p−2.

To each such a we associate its unique inverse a mod p, i.e. aa ≡ 1 mod p. Observe that a = a since then we

would have a

2

≡1 mod p which violates the preceding lemma as a = 1, a = p−1. Thus in multiplying all a in the

range 2 ≤a ≤ p −2, we pair them of with their inverses, and the net contribution of this product is therefore 1. In

symbols,

2 3 (p −2) ≡1 mod p.

In other words,

(p −1)! ≡1

Ñ

¸

2≤a≤p−2

j

é

(p −1) ≡1 1 (p −1) ≡−1 mod p.

This gives the result. u

223 Example If p ≡1 mod 4, prove that

Å

p −1

2

ã

! ≡−1 mod p.

Solution: In the product (p −1)! we pair off j, 1 ≤ j ≤(p −1)/2 with p − j. Observe that j(p − j) ≡−j

2

mod p. Hence

−1 ≡(p −1)! ≡

¸

1≤j≤(p−1)/2

−j

2

≡(−1)

(p−1)/2

Å

p −1

2

ã

! mod p.

As (−1)

(p−1)/2

= 1, we obtain the result.

224 Example (IMO 1970) Find the set of all positive integers n with the property that the set

¦n, n +1, n +2, n +3, n +4, n +5¦

can be partitioned into two sets such that the product of the numbers in one set equals the product of the numbers in the other

set.

Solution: We will show that no such partition exists. Suppose that we can have such a partition, with one of the subsets having

product of its members equal to A and the other having product of its members equal to B. We might have two possibilities.

The ﬁrst possibility is that exactly one of the numbers in the set ¦n, n +1, n +2, n +3, n +4, n +5¦ is divisible by 7, in which

case exactly one of A or B is divisible by 7, and so A B is not divisible by 7

2

, and so A B is not a square. The second possibility

is that all of the members of the set are relatively prime to 7. In this last case we have

n(n +1) (n +6) ≡1 2 6 ≡A B ≡−1 mod 7.

But if A = B then we are saying that there is an integer A such that A

2

≡ −1 mod 7, which is an impossibility, as −1 is not a

square mod 7. This ﬁnishes the proof.

Practice 81

Practice

Problem 7.1.1 Find all the natural numbers n for which

3[(n2

n

+1).

Problem 7.1.2 Prove that there are inﬁnitely many integers n

with n[2

n

+2.

Problem 7.1.3 Find all primes p such that p[2

p

+1.

Answer: p = 3 only.

Problem 7.1.4 If p and q are distinct primes prove that

pq[(a

pq

−a

p

−a

q

−a)

for all integers a.

Problem 7.1.5 If p is a prime prove that p[a

p

+ (p −1)!a for

all integers a.

Problem 7.1.6 If (mn, 42) = 1 prove that 168[m

6

−n

6

.

Problem 7.1.7 Let p and q be distinct primes. Prove that

q

p−1

+ p

q−1

≡1 mod pq.

Problem 7.1.8 If p is an odd prime prove that n

p

≡n mod 2p

for all integers n.

Problem 7.1.9 If p is an odd prime and p[m

p

+n

p

prove that

p

2

[m

p

+n

p

.

Problem 7.1.10 Prove that n > 1 is a prime if and only if

(n −1)! ≡−1 mod n.

Problem 7.1.11 Prove that if p is an odd prime

1

2

3

2

(p−2)

2

≡2

2

4

2

(p−1)

2

≡(−1)

(p−1)/2

mod p

Problem 7.1.12 Prove that 19[(2

2

6k+2

+3) for all nonnegative

integers k.

7.2 Euler’s Theorem

In this section we obtain a generalisation of Fermat’s Little Theorem, due to Euler. The proof is analogous to that of Fermat’s

Little Theorem.

225 Theorem (Euler’s Theorem) Let (a, n) = 1. Then a

φ(n)

≡1 mod n.

Proof: Let a

1

, a

2

, . . . , a

φ(n)

be the canonical reduced residues mod n. As (a, n) = 1, aa

1

, aa

2

, . . . , aa

φ(n)

also

forms a set of incongruent reduced residues. Thus

aa

1

aa

2

aa

φ(n)

≡a

1

a

2

a

φ(n)

mod n,

or

a

φ(n)

a

1

a

2

a

φ(n)

≡a

1

a

2

a

φ(n)

mod n.

As (a

1

a

2

a

φ(n)

, n) = 1, we may cancel the product a

1

a

2

a

φ(n)

from both sides of the congruence to obtain

Euler’s Theorem.u

Using Theorem ?? we obtain the following corollary.

226 Corollary Let (a, n) = 1. Then ord

n

a[φ(n).

227 Example Find the last two digits of 3

1000

.

Solution: As φ(100) = 40, by Euler’s Theorem, 3

40

≡1 mod 100. Thus

3

1000

= (3

40

)

25

≡1

25

= 1 mod 100,

and so the last two digits are 01.

82 Chapter 7

228 Example Find the last two digits of 7

7

1000

.

Solution: First observe that φ(100) = φ(2

2

)φ(5

2

) = (2

2

−2)(5

2

−5) = 40. Hence, by Euler’s Theorem, 7

40

≡ 1 mod 100.

Now, φ(40) =φ(2

3

)φ(5) =4 4 = 16, hence 7

16

≡1 mod 40. Finally, 1000 =16 62+8. This means that 7

1000

≡(7

16

)

62

7

8

≡

1

62

7

8

≡(7

4

)

2

≡1

2

≡1 mod 40. This means that 7

1000

= 1 +40t for some integer t. Upon assembling all this

7

7

1000

≡7

1+40t

≡7 (7

40

)

t

≡7 mod 100.

This means that the last two digits are 07.

229 Example (IMO 1978) m, n are natural numbers with 1 ≤ m < n. In their decimal representations, the last three digits of

1978

m

are equal, respectively, to the last three digits of 1978

n

. Find m, n such that m+n has its least value.

Solution: As m+n = n −m+2m, we minimise n −m. We are given that

1978

n

−1978

m

= 1978

m

(1978

n−m

−1)

is divisible by 1000 = 2

3

5

3

. Since the second factor is odd, 2

3

must divide the ﬁrst and so m ≥ 3. Now, ord

125

1978 is the

smallest positive integer s with

1978

s

≡1 mod 125.

By Euler’s Theorem

1978

100

≡1 mod 125

and so by Corollary 7.3 s[100. Since 125[(1978

s

−1) we have 5[(1978

s

−1), i.e., 1978

s

≡3

s

≡1 mod 5. Since s[100, this last

congruence implies that s = 4, 20, or 100. We now rule out the ﬁrst two possibilities.

Observe that

1978

4

≡(−22)

4

≡2

4

11

4

≡(4 121)

2

≡(−16)

2

≡6 mod 125.

This means that s = 4. Similarly

1978

20

≡1978

4

(1978

4

)

4

≡6 6

4

≡6 46 ≡26 mod 125.

This means that s =20 and so s =100. Since s is the smallest positive integer with 1978

s

≡1 mod 125, we take n−m=s =100

and m = 3, i.e., n = 103, m = 3, and ﬁnally, m+n = 106.

230 Example (IMO 1984) Find one pair of positive integers a, b such that:

(i) ab(a +b) is not divisible by 7.

(ii) (a +b)

7

−a

7

−b

7

is divisible by 7

7

. Justify your answer.

Solution: We ﬁrst factorise (a +b)

7

−a

7

−b

7

as ab(a +b)(a

2

+ab +b

2

)

2

. Using the Binomial Theorem we have

(a +b)

7

−a

7

−b

7

= 7(a

6

b +ab

6

+3(a

5

b

2

+a

2

b

5

) +5(a

4

b

3

+a

3

b

4

))

= 7ab(a

5

+b

5

+3ab(a

3

+b

3

) +5(a

2

b

2

)(a +b))

= 7ab(a +b)(a

4

+b

4

−a

3

b −ab

3

+a

2

b

2

+3ab(a

2

−ab +b

2

) +5ab)

= 7ab(a +b)(a

4

+b

4

+2(a

3

b +ab

3

) +3a

2

b

2

)

= 7ab(a +b)(a

2

+ab +b

2

)

2

.

The given hypotheses can be thus simpliﬁed to

(i)

′

ab(a +b) is not divisible by 7,

(ii)

′

a

2

+ab +b

2

is divisible by 7

3

.

Practice 83

As (a +b)

2

> a

2

+ab +b

2

≥ 7

3

, we obtain a +b ≥ 19. Using trial and error, we ﬁnd that a = 1, b = 18 give an answer, as

1

2

+1 18 +18

2

= 343 = 7

3

.

Let us look for more solutions by means of Euler’s Theorem. As a

3

−b

3

= (a −b)(a

2

+ab +b

2

), (ii)’ is implied by

(ii)

′′

ß

a

3

≡b

3

mod 7

3

a ≡b mod 7.

Now φ(7

3

) = (7 −1)7

2

= 3 98, and so if x is not divisible by 7 we have (x

98

)

3

≡ 1 mod 7

3

, which gives the ﬁrst part of (ii)’.

We must verify now the conditions of non-divisibility. For example, letting x = 2 we see that 2

98

≡ 4 mod 7. Thus letting

a = 2

98

, b = 1. Letting x = 3 we ﬁnd that 3

98

≡ 324 mod 7

3

. We leave to the reader to verify that a = 324, b = 1 is another

solution.

Practice

Problem 7.2.1 Show that for all natural numbers s, there is

an integer n divisible by s, such that the sum of the digits of n

equals s.

Problem 7.2.2 Prove that 504[n

9

−n

3

.

Problem 7.2.3 Prove that for odd integer n > 0, n[(2

n!

−1).

Problem 7.2.4 Let p [10 be a prime. Prove that p divides

inﬁnitely many numbers of the form

11. . . 11.

Problem 7.2.5 Find all natural numbers n that divide

1

n

+2

n

+ + (n −1)

n

.

Problem 7.2.6 Let (m, n) = 1. Prove that

m

φ(n)

+n

φ(n)

≡1 mod mn.

Problem 7.2.7 Find the last two digits of a

1001

if a

1

= 7, a

n

=

7

a

n−1

.

Problem 7.2.8 Find the remainder of

10

10

+10

10

2

+ +10

10

10

upon division by 7.

Problem 7.2.9 Prove that for every natural number n there

exists some power of 2 whose ﬁnal n digits are all ones and

twos.

Problem 7.2.10 (USAMO 1982) Prove that there exists a

positive integer k such that k 2

n

+1 is composite for every

positive integer n.

Problem 7.2.11 (Putnam 1985) Describe the sequence a

1

=

3, a

n

= 3

a

n−1

mod 100 for large n.

Chapter 8

Scales of Notation

8.1 The Decimal Scale

As we all know, any natural number n can be written in the form

n = a

0

10

k

+a

1

10

k−1

+ +a

k−1

10 +a

k

,

where 1 ≤a

0

≤9, 0 ≤a

j

≤9, j ≥1. For example, 65789 = 6 10

4

+5 10

3

+7 10

2

+8 10 +9.

231 Example Find all whole numbers which begin with the digit 6 and decrease 25 times when this digit is deleted.

Solution: Let the number sought have n +1 digits. Then this number can be written as 6 10

n

+y, where y is a number with n

digits (it may begin with one or several zeroes). The condition of the problem stipulates that

6 10

n

+y = 25 y

whence

y =

6 10

n

24

.

From this we gather that n ≥2 (otherwise, 6 10

n

would not be divisible by 24). For n ≥2, y = 25 10

k−2

, that is, y has the form

250 0(n −2 zeroes). We conclude that all the numbers sought have the form 625 0. . . 0

. .. .

n−2 zeroes

.

232 Example (IMO 1968) Find all natural numbers x such that the product of their digits (in decimal notation) equals x

2

−

10x −22.

Solution: Let x have the form

x = a

0

+a

1

10 +a

2

10

2

+ +a

n−1

10

n−1

, a

k

≤9, a

n−1

= 0.

Let P(x) be the product of the digits of x, P(x) =x

2

−10x−22. Now, P(x) = a

0

a

1

a

n−1

≤9

n−1

a

n−1

< 10

n−1

a

n−1

≤x (strict

inequality occurs when x has more than one digit). So x

2

−10x −22 < x, and we deduce that x < 13, whence x has either one

digit or x =10, 11, 13. If x had one digit, then a

0

=x

2

−10x−22, but this equation has no integral solutions. If x =10, P(x) =0,

but x

2

−10x −22 = 0. If x = 11, P(x) = 1, but x

2

−10x −22 = 1. If x = 12, P(x) = 2 and x

2

−10x −22 = 2. Therefore, x = 12

is the only solution.

233 Example A whole number decreases an integral number of times when its last digit is deleted. Find all such numbers.

84

The Decimal Scale 85

Solution: Let 0 ≤ y ≤ 9, and 10x +y = mx, m and x natural numbers. This requires 10 +y/x = m, an integer. We must have

x[y. If y = 0, any natural number x will do, and we obtain the multiples of 10. If y = 1, x = 1, and we obtain 11. If y = 2, x = 1

or x = 2 and we obtain 12 and 22. Continuing in this fashion, the sought numbers are: the multiples of 10, 11, 12, 13, 14, 15,

16, 17, 18, 19,22, 24, 26, 28, 33, 36, 39, 44, 48, 55, 66, 77, 88, and 99.

234 Example Let A be a positive integer, and A

′

be a number written with the aid of the same digits with are arranged in some

other order. Prove that if A+A

′

= 10

10

, then A is divisible by 10.

Solution: Clearly A and A

′

must have ten digits. Let A = a

10

a

9

. . . a

1

be the consecutive digits of A and A

′

= a

′

10

a

′

9

. . . a

′

1

. Now,

A+A

′

=10

10

if and only if there is a j, 0 ≤ j ≤9 for which a

1

+a

′

1

=a

2

+a

′

2

= =a

j

+a

′

j

=0, a

j+1

+a

′

j+1

=10, a

j+2

+a

′

j+2

=

a

j+3

+a

′

j+3

= = a

10

+a

′

10

= 9. Notice that j = 0 implies that there are no sums of the form a

j+k

+a

′

j+k

, k ≥ 2, and j = 9

implies that there are no sums of the form a

l

+a

′

l

, 1 ≤l ≤ j. On adding all these sums, we gather

a

1

+a

′

1

+a

2

+a

′

2

+ +a

10

+a

′

10

= 10 +9(9 − j).

Since the a

′

s

are a permutation of the a

s

, we see that the sinistral side of the above equality is the even number 2(a

1

+a

2

+ +

a

10

). This implies that j must be odd. But this implies that a

1

+a

′

1

= 0, which gives the result.

235 Example (AIME 1994) Given a positive integer n, let p(n) be the product of the non-zero digits of n. (If n has only one

digit, then p(n) is equal to that digit.) Let

S = p(1) + p(2) + + p(999).

What is the largest prime factor of S?

Solution: Observe that non-zero digits are the ones that matter. So, for example, the numbers 180, 108, 118, 810, 800, and 811

have the same value p(n).

We obtain all the three digit numbers from 001 to 999 by expanding the product

(0 +1 +2 + +9)

3

−0,

where we subtracted a 0 in order to eliminate 000. Thus

(0 +1 +2 +9)

3

−0 = 001 +002 + +999.

In order to obtain p(n) for a particular number, we just have to substitute the (possible) zeroes in the decimal representation, by

1’s, and so

p(1) + p(2) + + p(n) = 111 +112 + +999 = (1 +1 +2 + +9)

3

−1,

which equals 46

3

−1. (In the last sum, 111 is repeated various times, once for 001, once for 011, once for 100, once for 101,

once for 110, etc.) As 46

3

−1 = 3

3

5 7 103, the number required is 103.

236 Example (AIME 1992) Let S be the set of all rational numbers r, 0 < r < 1, that have a repeating decimal expansion of the

form

0.abcabcabc. . . = 0.abc,

where the digits a, b, c are not necessarily distinct. To write the elements of S as fractions in lowest terms, how many different

numerators are required?

Solution: Observe that 0.abcabcabc. . . =

abc

999

, and 999 = 3

3

37. If abc is neither divisible by 3 nor 37, the fraction is already

in lowest terms. By the Inclusion-Exclusion Principle, there are

999 − (999/3 +999/37) +999/3 37 = 648

such numbers. Also, fractions of the form s/37, where 3[s, 37 [s are in S. There are 12 fractions of this kind. (Observe that we

do not consider fractions of the form l/3

t

, 37[s, 3 [l, because fractions of this form are greater than 1, and thus not in S.)

The total number of distinct numerators in the set of reduced fractions is thus 640 +12 = 660.

86 Chapter 8

237 Example (Putnam 1956) Prove that every positive integer has a multiple whose decimal representation involves all 10

digits.

Solution: Let n be an arbitrary positive integer with k digits. Let m = 123456789 10

k+1

. Then all of the n consecutive integers

m+1, m+2, . . . m+n begin with 1234567890 and one of them is divisible by n.

238 Example (Putnam 1987) The sequence of digits

12345678910111213141516171819202122. . .

is obtained by writing the positive integers in order. If the 10

n

digit of this sequence occurs in the part in which the m-digit

numbers are placed, deﬁne f (n) to be m. For example f (2) = 2, because the hundredth digit enters the sequence in the

placement of the two-digit integer 55. Find, with proof, f (1987).

Solution: There are 9 10

j−1

j-digit positive integers. The total number of digits in numbers with at most r digits is g(r) =

r

¸

j=1

j 9 10

r−1

= r10

r

−

10

r

−1

9

. As 0 <

10

r

−1

9

< 10

r

, we get (r −1)10

r

< g(r) < r10

r

. Thus g(1983) < 1983 10

1983

<

10

4

10

1983

= 10

1987

and g(1984) > 1983 10

1984

> 10

3

10

1984

. Therefore f (1987) = 1984.

Practice

Problem 8.1.1 Prove that there is no whole number which de-

creases 35 times when its initial digit is deleted.

Problem 8.1.2 A whole number is equal to the arithmetic

mean of all the numbers obtained from the given number with

the aid of all possible permutations of its digits. Find all whole

numbers with that property.

Problem 8.1.3 (AIME 1989) Suppose that n is a positive in-

teger and d is a single digit in base-ten. Find n if

n

810

= 0.d25d25d25d25. . ..

Problem 8.1.4 (AIME 1992) For how many pairs of consec-

utive integers in

¦1000, 1001, . . ., 2000¦

is no carrying required when the two integers are added?

Problem 8.1.5 Let m be a seventeen-digit positive integer and

let N be number obtained from m by writing the same digits in

reversed order. Prove that at least one digit in the decimal

representation of the number M+N is even.

Problem 8.1.6 Given that

e = 2 +

1

2!

+

1

3!

+

1

4!

+ ,

prove that e is irrational.

Problem 8.1.7 Let t be a positive real number. Prove that

there is a positive integer n such that the decimal expansion

of nt contains a 7.

Problem 8.1.8 (AIME 1988) Find the smallest positive inte-

ger whose cube ends in 888.

Problem 8.1.9 (AIME 1987) An ordered pair (m, n) of non-

negative integers is called simple if the addition m+n requires

no carrying. Find the number of simple ordered pairs of non-

negative integers that sum 1492.

Problem 8.1.10 (AIME 1986) In the parlor game, the “ma-

gician” asks one of the participants to think of a three-digit

number abc, where a, b, c represent the digits of the number

in the order indicated. The magician asks his victim to form

the numbers acb, bac, cab and cba, to add the number and to

reveal their sum N. If told the value of N, the magician can

identity abc. Play the magician and determine abc if N = 319.

Problem 8.1.11 The integer n is the smallest multiple of 15

such that every digit of n is either 0 or 8. Compute n/15.

Problem 8.1.12 (AIME 1988) For any positive integer k, let

f

1

(k) denote the square of the sums of the digits of k. For

n ≥2, let f

n

(k) = f

1

( f

n−1

(k)). Find f

1988

(11).

Problem 8.1.13 (IMO 1969) Determine all three-digit num-

bers N that are divisible by 11 and such that N/11 equals the

Non-decimal Scales 87

sum of the squares of the digits of N.

Problem 8.1.14 (IMO 1962) Find the smallest natural num-

ber having last digit is 6 and if this 6 is erased and put in front

of the other digits, the resulting number is four times as large

as the original number.

Problem 8.1.15 1. Show that Champernowne’s number

χ = 0.123456789101112131415161718192021. . .

is irrational.

2. Let r ∈ Q and let ε > 0 be given. Prove that there exists

a positive integer n such that

[10

n

χ −r[ < ε.

Problem 8.1.16 A Liouville number is a real number x such

that for every positive k there exist integers a and b ≥ 2, such

that

[x −a/b[ < b

−k

.

Prove or disprove that π is the sum of two Liouville numbers.

Problem 8.1.17 Given that

1/49 =0.020408163265306122448979591836734693877551,

ﬁnd the last thousand digits of

1 +50 +50

2

+ +50

999

.

8.2 Non-decimal Scales

The fact that most people have ten ﬁngers has ﬁxed our scale of notation to the decimal. Given any positive integer r > 1, we

can, however, express any number in base r.

239 Example Express the decimal number 5213 in base-seven.

Solution: Observe that 5213 < 7

5

. We thus want to ﬁnd 0 ≤a

0

, . . . , a

4

≤6, a

4

= 0, such that

5213 = a

4

7

4

+a

3

7

3

+a

2

7

2

+a

1

7 +a

0

.

Now, divide by 7

4

to obtain

2 +proper fraction = a

4

+proper fraction.

Since a

4

is an integer, it must be the case that a

4

= 2. Thus 5213 −2 7

4

= 411 = a

3

7

3

+a

2

7

2

+a

1

7 +a

0

. Dividing 411 by 7

3

we obtain

1 +proper fraction = a

3

+proper fraction.

Thus a

3

= 1. Continuing in this way we deduce that 5213 = 21125

7

.

240 Example Express the decimal number 13/16 in base-six.

Solution: Write

13

16

=

a

1

6

+

a

2

6

2

+

a

3

6

3

+. . . .

Multiply by 6 to obtain

4 +proper fraction = a

1

+proper fraction.

Thus a

1

= 4. Hence 13/16 −4/6 = 7/48 =

a

2

6

2

+

a

3

6

3

+. . .. Multiply by 6

2

to obtain

5 +proper fraction = a

2

+proper fraction.

We gather that a

2

= 5. Continuing in this fashion, we deduce that 13/16 = .4513

6

.

241 Example Prove that 4.41 is a perfect square in any scale of notation.

Solution: If 4.41 is in scale r, then

4.41 = 4 +

4

r

+

1

r

2

=

Å

2 +

1

r

ã

2

.

88 Chapter 8

242 Example Let x denote the greatest integer less than or equal to x. Does the equation

x+2x+4x+8x+16x+32x= 12345

have a solution?

Solution: We show that there is no such x. Recall that x satisﬁes the inequalities x −1 < x ≤x. Thus

x −1 +2x −1 +4x −1+ +32x −1 < x+2x+4x+8x

+16x+32x

≤ x +2x +4x + +32x.

From this we see that 63x −6 < 12345 ≤63x. Hence 195 < x < 196.

Write then x in base-two:

x = 195 +

a

1

2

+

a

2

2

2

+

a

3

2

3

+. . . ,

with a

k

= 0 or 1. Then

2x = 2 195 +a

1

,

4x = 4 195 +2a

1

+a

2

,

8x = 8 195 +4a

1

+2a

2

+a

3

,

16x = 16 195 +8a

1

+4a

2

+2a

3

+a

4

,

32x = 32 195 +16a

1

+8a

2

+4a

3

+2a

4

+a

5

.

Adding we ﬁnd that x+2x+4x+8x+16x+32x = 63 195+31a

1

+15a

2

+7a

3

+3a

4

+a

5

, i.e. 31a

1

+15a

2

+

7a

3

+3a

4

+a

5

= 60. This cannot be because 31a

1

+15a

2

+7a

3

+3a

4

+a

5

≤31 +15 +7 +3+1 = 57 < 60.

243 Example (AHSME 1993) Given 0 ≤x

0

< 1, let

x

n

=

ß

2x

n−1

if 2x

n−1

< 1

2x

n−1

−1 if 2x

n−1

≥1

for all integers n > 0. For how many x

0

is it true that x

0

= x

5

?

Solution: Write x

0

in base-two,

x

0

=

∞

¸

k=1

a

n

2

n

a

n

= 0 or 1.

The algorithm given just moves the binary point one unit to the right. For x

0

to equal x

5

we need 0.a

1

a

2

a

3

a

4

a

5

a

6

a

7

. . . =

0.a

6

a

7

a

8

a

9

a

10

a

11

a

12

. . .. This will happen if and only if x

0

has a repeating expansion with a

1

a

2

a

3

a

4

a

5

as the repeating block .

There are 2

5

= 32 such blocks. But if a

1

= a

2

= = a

5

= 1, then x

0

= 1, which is outside [0, 1). The total number of values

for which x

0

= x

5

is thus 32 −1 = 31.

244 Example (AIME 1986) The increasing sequence

1, 3, 4, 9, 10, 12, 13, . . .

consists of all those positive integers which are powers of 3 or sums distinct powers of 3. Find the hundredth term of the

sequence.

Solution: If the terms of the sequence are written in base-3, they comprise the positive integers which do not contain the digit

2. Thus, the terms of the sequence in ascending order are thus

1, 10, 11, 100, 101, 110, 111, . . ..

In the binary scale, these numbers are, of course, 1, 2, 3, . . . . To obtain the 100-th term of the sequence we just write 100 in

binary 100 = 1100100

2

and translate this into ternary: 1100100

3

= 3

6

+3

5

+3

2

= 981.

Practice

A theorem of Kummer 89

Problem 8.2.1 (Putnam, 1987) For each positive integer n,

let α(n) be the number of zeroes in the base-three represen-

tation of n. For which positive real numbers x does the series

∞

¸

n=1

x

α(n)

n

3

converge?

Problem 8.2.2 Prove that for x ∈ R, x ≥0, one has

∞

¸

n=1

(−1)

2

n

x

2

n

= 1 −2(x −x).

Problem 8.2.3 (Putnam, 1981) Let E(n) denote the largest k

such that 5

k

is an integral divisor of 1

1

2

2

3

3

n

n

. Calculate

lim

n→∞

E(n)

n

2

.

Problem 8.2.4 (AHSME, 1982) The base-eight representa-

tion of a perfect square is ab3c with a = 0. Find the value

of c.

Problem 8.2.5 (Putnam, 1977) An ordered triple of

(x

1

, x

2

, x

3

) of positive irrational numbers with x

1

+x

2

+x

3

= 1

is called balanced if x

n

< 1/2 for all 1 ≤ n ≤ 3. If a triple

is not balanced, say x

j

> 1/2, one performs the following

“balancing act”:

B(x

1

, x

2

, x

3

) = (x

′

1

, x

′

2

, x

′

3

),

where x

′

i

= 2x

i

if x

i

= x

j

and x

′

j

= 2x

j

−1. If the new triple

is not balanced, one performs the balancing act on it. Does

continuation of this process always lead to a balanced triple

after a ﬁnite number of performances of the balancing act?

Problem 8.2.6 Let C denote the class of positive integers

which, when written in base-three, do not require the digit 2.

Show that no three integers in C are in arithmetic progression.

Problem 8.2.7 Let B(n) be the number of 1’s in the base-two

expansion of n. For example, B(6) = B(110

2

) = 2, B(15) =

B(1111

2

) = 4.

1. (PUTNAM 1981) Is

exp

∞

¸

n=1

B(n)

n

2

+n

a rational number?

2. (PUTNAM 1984) Express

2

m

−1

¸

n=0

(−1)

B(n)

n

m

in the form (−1)

m

a

f (m)

(g(m))! where a is an integer

and f , g are polynomials.

Problem 8.2.8 What is the largest integer that I should be

permitted to choose so that you may determine my number in

twenty “yes” or “no” questions?

8.3 A theorem of Kummer

We ﬁrst establish the following theorem.

245 Theorem (Legendre) Let p be a prime and let n = a

0

p

k

+a

1

p

k−1

+ +a

k−1

p +a

k

be the base-p expansion of n. The

exact power m of a prime p dividing n! is given by

m =

n − (a

0

+a

1

+ +a

k

)

p −1

.

Proof: By De Polignac’s Formula

m =

∞

¸

k=1

n

p

k

.

90 Chapter 8

Now, n/p = a

0

p

k−1

+a

1

p

k−2

+ a

k−2

p +a

k−1

, n/p

2

= a

0

p

k−2

+a

1

p

k−3

+ +a

k−2

, . . . , n/p

k

= a

0

.

Thus

∞

¸

k=1

n/p

k

= a

0

(1 + p + p

2

+ + p

k−1

) +a

1

(1 + p + p

2

+ + p

k−2

)+

+a

k−1

(1 + p) +a

k

= a

0

p

k

−1

p −1

+a

1

p

k−1

−1

p −1

+ +a

k−1

p

2

−1

p −1

+a

k

p −1

p −1

=

a

0

p

k

+a

1

p

k−1

+ +a

k

− (a

0

+a

1

+ +a

k

)

p −1

=

n − (a

0

+a

1

+ +a

k

)

p −1

,

as wanted.u

246 Theorem (Kummer’s Theorem) The exact power of a prime p dividing the binomial coefﬁcient

Ç

a +b

a

å

is equal to the

number of “carry-overs” when performing the addition of a, b written in base p.

Proof: Let a = a

0

+a

1

p + +a

k

p

k

, b = b

0

+b

1

p + +b

k

p

k

, 0 ≤ a

j

, b

j

≤ p −1, and a

k

+b

k

> 0. Let S

a

=

k

¸

j=0

a

j

, S

b

=

k

¸

j=0

b

j

. Let c

j

, 0 ≤c

j

≤ p −1, and ε

j

= 0 or 1, be deﬁned as follows:

a

0

+b

0

= ε

0

p +c

0

,

ε

0

+a

1

+b

1

= ε

1

p +c

1

,

ε

1

+a

2

+b

2

= ε

2

p +c

2

,

.

.

.

ε

k−1

+a

k

+b

k

= ε

k

p +c

k

.

Multiplying all these equalities successively by 1, p, p

2

, . . . and adding them:

a +b +ε

0

p +ε

1

p

2

+. . . +ε

k−1

p

k

= ε

0

p +ε

1

p

2

+. . . +ε

k−1

p

k

+ε

k

p

k+1

+c

0

+c

1

p + +c

k

p

k

.

We deduce that a +b = c

0

+c

1

p + +c

k

p

k

+ε

k

p

k+1

. By adding all the equalities above, we obtain similarly:

S

a

+S

b

+ (ε

0

+ε

1

+ +ε

k−1

) = (ε

0

+ε

1

+ +ε

k

)p +S

a+b

−ε

k

.

Upon using Legendre’s result from above,

(p −1)m = (a +b) −S

a+b

−a +S

a

−b +S

b

= (p −1)(ε

0

+ε

1

+ +ε

k

),

which gives the result.u

Chapter 9

Miscellaneous Problems

247 Example Prove that

¸

p

p prime

1

p

diverges.

Solution: Let F

x

denote the family consisting of the integer 1 and the positive integers n all whose prime factors are less than

or equal to x. By the Unique Factorisation Theorem

¸

p≤x

p prime

Å

1 +

1

p

+

1

p

2

+

ã

=

¸

n∈F

x

1

n

. (9.1)

Now,

¸

n∈F

x

1

n

>

¸

n≤x

1

n

.

As the harmonic series diverges, the product on the sinistral side of 2.3.3 diverges as x →∞. But

¸

p≤x

p prime

Å

1 +

1

p

+

1

p

2

+

ã

=

¸

p≤x

p prime

1

p

+O(1).

This ﬁnishes the proof.

248 Example Prove that for each positive integer k there exist inﬁnitely many even positive integers which can be written in

more than k ways as the sum of two odd primes.

Solution: Let a

k

denote the number of ways in which 2k can be written as the sum of two odd primes. Assume that a

k

≤C ∀k

for some positive constant C. Then

Ü

¸

p>2

p prime

x

p

ê

2

=

∞

¸

k=2

a

k

x

2k

≤C

x

4

1 −x

2

.

This yields

¸

p>2

p prime

x

p−1

≤

√

C

x

√

1 −x

2

.

91

92 Chapter 9

Integrating term by term,

¸

p>2

p prime

1

p

≤

√

C

1

0

x

√

1 −x

2

dx =

√

C.

But the leftmost series is divergent, and we obtain a contradiction.

249 Example (IMO 1976) Determine, with proof, the largest number which is the product of positive integers whose sum is

1976.

Solution: Suppose that

a

1

+a

2

+ +a

n

= 1976;

we want to maximise

n

¸

k=1

a

k

. We shall replace some of the a

k

so that the product is enlarged, but the sum remains the same. By

the arithmetic mean-geometric mean inequality

n

¸

k=1

a

k

1/n

≤

a

1

+a

2

+ +a

n

n

,

with equality if and only if a

1

= a

2

= = a

n

. Thus we want to make the a

k

as equal as possible.

If we have an a

k

≥4, we replace it by two numbers 2, a

k

−2. Then the sum is not affected, but 2(a

k

−2) ≥a

k

, since we are

assuming a

k

≥ 4. Therefore, in order to maximise the product, we must take a

k

= 2 or a

k

= 3. We must take as many 2’s and

3’s as possible.

Now, 2+2+2 =3+3, but 2

3

<3

2

, thus we should take no more than two 2’s. Since 1976 =3 658+2, the largest possible

product is 2 3

658

.

250 Example (USAMO 1983) Consider an open interval of length 1/n on the real line, where n is a positive integer. Prove that

the number of irreducible fractions a/b, 1 ≤b ≤n, contained in the given interval is at most (n +1)/2.

Solution: Divide the rational numbers in (x, x +1/n) into two sets: ¦

s

k

t

k

¦, k = 1, 2, . . . , r, with denominators 1 ≤ t

k

≤ n/2 and

those u

k

/v

k

, k = 1, 2, . . . , s with denominators n/2 < v

k

≤ n, where all these fractions are in reduced form. Now, for every t

k

there are integers c

k

such that n/2 ≤c

k

t

k

≤n. Deﬁne u

s+k

= c

k

s

k

, v

s+k

= c

k

t

k

, y

k+r

= u

k+r

/v

k+r

. No two of the y

l

, 1 ≤l ≤r +s

are equal, for otherwise y

j

= y

k

would yield

[u

k

/v

k

−u

i

/v

i

[ ≥1/v

i

≥1/n,

which contradicts that the open interval is of length 1/n. Hence the number of distinct rationals is r +s ≤n−n/2≤(n+1)/2.

Aliter: Suppose to the contrary that we have at least (n +1)/2+1 = a fractions. Let s

k

, t

k

, 1 ≤ k ≤ a be the set of

numerators and denominators. The set of denominators is a subset of

¦1, 2, . . . , 2(a −1)¦.

By the Pigeonhole Principle, t

i

[t

k

for some i, k, say t

k

= mt

i

. But then

[s

k

/t

k

−s

i

/t

i

[ =[ms

i

−s

k

[/t

k

≥1/n,

contradicting the hypothesis that the open interval is of length 1/n.

251 Example Let

Q

r,s

=

(rs)!

r!s!

.

Show that Q

r,ps

≡Q

r,s

mod p, where p is a prime

Practice 93

Solution: As

Q

r,s

=

r

¸

j=1

Ç

js −1

s −1

å

and

Q

r,ps

=

r

¸

j=1

Ç

j ps −1

ps −1

å

,

it follows from

(1 +x)

j ps−1

≡(1 +x

p

)

js−1

(1 +x)

p−1

mod p

that

Ç

j ps −1

ps −1

å

≡

Ç

js −1

s −1

å

mod p,

whence the result.

Practice

Problem 9.0.1 Find a four-digit number which is a perfect

square such that its ﬁrst two digits are equal to each other

and its last two digits are equal to each other.

Problem 9.0.2 Find all integral solutions of the equation

x

¸

k=1

k! = y

2

.

Problem 9.0.3 Find all integral solutions of the equation

x

¸

k=1

k! = y

z

.

Problem 9.0.4 (USAMO 1985) Determine whether there are

any positive integral solutions to the simultaneous equations

x

2

1

+x

2

2

+ +x

2

1985

= y

3

,

x

3

1

+x

3

2

+ +x

3

1985

= z

2

with distinct integers x

1

, x

2

, . . . , x

1985

.

Problem 9.0.5 Show that the Diophantine equation

1

a

1

+

1

a

2

+. . . +

1

a

n−1

+

1

a

n

+

1

a

1

a

2

a

n

has at least one solution for every n ∈ N.

Problem 9.0.6 (AIME 1987) Find the largest possible value

of k for which 3

11

is expressible as the sum of k consecutive

positive integers.

Problem 9.0.7 (AIME 1987) Let M be the smallest positive

integer whose cube is of the form n +r, where n ∈ N, 0 < r <

1/1000. Find n.

Problem 9.0.8 Determine two-parameter solutions for the

“almost” Fermat Diophantine equations

x

n−1

+y

n−1

= z

n

,

x

n+1

+y

n+1

= z

n

,

x

n+1

+y

n−1

= z

n

.

Problem 9.0.9 (AIME 1984) What is the largest even integer

which cannot be written as the sum of two odd composite num-

bers?

Problem 9.0.10 Prove that are inﬁnitely many nonnegative

integers n which cannot be written as n = x

2

+y

3

+z

6

for non-

negative integers x, y, z.

Problem 9.0.11 Find the integral solutions of

x

2

+x = y

4

+y

3

+y

2

+y.

Problem 9.0.12 Show that there are inﬁnitely many integers

x, y such that

3x

2

−7y

2

= −1.

Problem 9.0.13 Prove that

1.

a

3

+b

3

+c

3

−3abc = (a+b+c)(a

2

+b

2

+c

2

−ab−bc−ca).

2. Find integers a, b, c such that 1987 = a

3

+ b

3

+ c

3

−

3abc.

94 Chapter 9

3. Find polynomials P, Q, R in x, y, z such that

P

3

+Q

3

+R

3

−3PQR = (x

3

+y

3

+z

3

−3xyz)

2

4. Can you ﬁnd integers a, b, c with 1987

2

= a

3

+b

3

+c

3

−

3abc?

Problem 9.0.14 Find all integers n such that n

4

+n +7 is a

perfect square.

Problem 9.0.15 Prove that 1991

1991

is not the sum of two per-

fect squares.

Problem 9.0.16 Find inﬁnitely many integers x >1, y >1, z >

1 such that

x!y! = z!.

Problem 9.0.17 Find all positive integers with

m

n

−n

m

= 1.

Problem 9.0.18 Find all integers with

x

4

−2y

2

= 1.

Problem 9.0.19 Prove that for every positive integer k there

exists a sequence of k consecutive positive integers none of

which can be represented as the sum of two squares.

Problem 9.0.20 (IMO 1977) In a ﬁnite sequence of real num-

bers, the sumof any seven successive terms is negative, and the

sum of any eleven successive terms is positive. Determine the

maximum number of terms in the sequence.

Problem 9.0.21 Determine an inﬁnite series of terms such

that each term of the series is a perfect square and the sum

of the series at any point is also a perfect square.

Problem 9.0.22 Prove that any positive rational integer can

be expressed as a ﬁnite sum of distinct terms of the harmonic

series, 1, 1/2, 1/3, . . ..

Problem 9.0.23 (Wostenholme’s Theorem) Let p > 3 be a

prime. If

a

b

= 1 +

1

2

+

1

3

+ +

1

p −1

,

then p

2

[a.

Problem 9.0.24 Prove that the number of odd binomial coef-

ﬁcients in any row of Pascal’s Triangle is a power of 2.

Problem 9.0.25 Prove that the coefﬁcients of a binomial ex-

pansion are odd if and only if n is of the form 2

k

−1.

Problem 9.0.26 Let the numbers c

i

be deﬁned by the power

series identity

(1 +x +x

2

+ +x

p−1

)/(1 −x)

p−1

:= 1 +c

1

x +c

2

x

2

+ .

Show that c

i

≡0 mod p for all i ≥1.

Problem 9.0.27 Let p be a prime. Show that

Ç

p −1

k

å

≡(−1)

k

mod p

for all 0 ≤k ≤ p −1.

Problem 9.0.28 (Putnam 1977) Let p be a prime and let a ≥

b > 0 be integers. Prove that

Ç

pa

pb

å

≡

Ç

a

b

å

mod p.

Problem 9.0.29 Demonstrate that for a prime p and k ∈ N,

Ç

p

k

a

å

≡0 mod p,

for 0 < a < p

k

.

Problem 9.0.30 Let p be a prime and let k, a ∈ N, 0 ≤ a ≤

p

k

−1. Demonstrate that

Ç

p

k

−1

a

å

≡(−1)

a

mod p.

Copyright c 2007 David Anthony SANTOS. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

GNU Free Documentation License

Version 1.2, November 2002 Copyright c 2000,2001,2002 Free Software Foundation, Inc.

51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The purpose of this License is to make a manual, textbook, or other functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modiﬁcations made by others. This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

**1. APPLICABILITY AND DEFINITIONS
**

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A “Modiﬁed Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modiﬁcations and/or translated into another language. A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not ﬁt the above deﬁnition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose speciﬁcation is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent ﬁle format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modiﬁcation by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”. Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modiﬁcation. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text. A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a speciﬁc section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this deﬁnition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to ﬁt legibly, you should put the ﬁrst ones listed (as many as ﬁt reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

iii

unmodiﬁed. You may extract a single document from such a collection. if it has fewer than ﬁve). L. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License. be listed in the History section of the Document). If the Cover Text requirement of section 3 is applicable to these copies of the Document. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works. and all the license notices in the Document. 9. Preserve all the Invariant Sections of the Document. add their titles to the list of Invariant Sections in the Modiﬁed Version’s license notice.iv You may copy and distribute a Modiﬁed Version of the Document under the conditions of sections 2 and 3 above. These titles must be distinct from any other section titles. parties who have received copies. the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate. Preserve the network location. and will automatically terminate your rights under this License. together with at least ﬁve of the principal authors of the Document (all of its principal authors. and add to it an item stating at least the title. this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. C. or if the original publisher of the version it refers to gives permission. is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. one or more persons or entities responsible for authorship of the modiﬁcations in the Modiﬁed Version. unless they release you from this requirement. Such a section may not be included in the Modiﬁed Version. If the Modiﬁed Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document. Preserve its Title. These may be placed in the “History” section. statements of peer review or that the text has been approved by an organization as the authoritative deﬁnition of a standard. authors. Preserve all the copyright notices of the Document. given in the Document for public access to a Transparent copy of the Document. under the terms deﬁned in section 4 above for modiﬁed versions. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. You may omit a network location for a work that was published at least four years before the Document itself. new authors. Include an unaltered copy of this License. you may not add another. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modiﬁed Version. H. and distribute it individually under this License. and publisher of the Document as given on its Title Page. J. thus licensing distribution and modiﬁcation of the Modiﬁed Version to whoever possesses a copy of it. Preserve the section Entitled “History”. sublicense or distribute the Document is void. 5. provided that you also include the original English version of this License and the original versions of those notices and disclaimers. and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. provided it contains nothing but endorsements of your Modiﬁed Version by various parties–for example. but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. Preserve the Title of the section. then add an item describing the Modiﬁed Version as stated in the previous sentence. The combined work need only contain one copy of this License. and multiple identical Invariant Sections may be replaced with a single copy. the name of the original author or publisher of that section if known. Replacing Invariant Sections with translations requires special permission from their copyright holders. make the title of each such section unique by adding at the end of it. State on the Title page the name of the publisher of the Modiﬁed Version. and list them all as Invariant Sections of your combined work in its license notice. You may add a section Entitled “Endorsements”. In the combination. Include. and publisher of the Modiﬁed Version as given on the Title Page. and replace the individual copies of this License in the various documents with a single copy that is included in the collection. I. provided you insert a copy of this License into the extracted document. from you under this License will not have their licenses terminated so long as such parties remain in full compliance. the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 8. you may at your option designate some or all of these sections as invariant. K. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice. or distribute the Document except as expressly provided for under this License. create one stating the title. List on the Title Page. If a section in the Document is Entitled “Acknowledgements”. “Dedications”. F. in parentheses. If there are multiple Invariant Sections with the same name but different contents. if any. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. You may use the same title as a previous version if the original publisher of that version gives permission. Do not retitle any existing section to be Entitled “Endorsements” or to conﬂict in title with any Invariant Section. Delete any section Entitled “Endorsements”. you must do these things in the Modiﬁed Version: A. the original version will prevail. If the Document already includes a cover text for the same cover. You may include a translation of this License. or else a unique number. or rights. and any sections Entitled “Dedications”. G. 7. forming one section Entitled “History”. To do this. in or on a volume of a storage or distribution medium. immediately after the copyright notices. provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. When the Document is included in an aggregate. if any) a title distinct from that of the Document. Add an appropriate copyright notice for your modiﬁcations adjacent to the other copyright notices. year. and that you preserve all their Warranty Disclaimers. N. year. likewise combine any sections Entitled “Acknowledgements”. 10. to the end of the list of Cover Texts in the Modiﬁed Version. Otherwise they must appear on printed covers that bracket the whole aggregate. You must delete all sections Entitled “Endorsements”. For any section Entitled “Acknowledgements” or “Dedications”. you must combine any sections Entitled “History” in the various original documents. if there were any. sublicense. as the publisher. FUTURE REVISIONS OF THIS LICENSE . and a passage of up to 25 words as a Back-Cover Text. TRANSLATION Translation is considered a kind of modiﬁcation. Use in the Title Page (and on the covers. and any Warranty Disclaimers. Any other attempt to copy. However. TERMINATION You may not copy. M. B. Preserve any Warranty Disclaimers. as authors. 6. modify. so you may distribute translations of the Document under the terms of section 4. If there is no section Entitled “History” in the Document. in the form shown in the Addendum below. on explicit permission from the previous publisher that added the old one. or the electronic equivalent of covers if the Document is in electronic form. and from those of previous versions (which should. then if the Document is less than one half of the entire aggregate. and likewise the network locations given in the Document for previous versions it was based on. D. and follow this License in all other respects regarding verbatim copying of that document. provided that you release the Modiﬁed Version under precisely this License. previously added by you or by arrangement made by the same entity you are acting on behalf of. or “History”. COMBINING DOCUMENTS You may combine the Document with other documents released under this License. unaltered in their text and in their titles. but you may replace the old one. modify. O. E. a license notice giving the public permission to use the Modiﬁed Version under the terms of this License. You may add a passage of up to ﬁve words as a Front-Cover Text. with the Modiﬁed Version ﬁlling the role of the Document. Section numbers or the equivalent are not considered part of the section titles. In addition. provided that you include in the combination all of the Invariant Sections of all of the original documents.

Such new versions will be similar in spirit to the present version. See http://www. If the Document speciﬁes that a particular numbered version of this License “or any later version” applies to it. Barcelona. you may choose any version ever published (not as a draft) by the Free Software Foundation. but may differ in detail to address new problems or concerns.gnu.v The Free Software Foundation may publish new. Que sea golpeado por la parálisis y todos sus miembros arruinados. -Maldición anónima contra los ladrones de libros en el monasterio de San Pedro. que arda en las llamas del Inﬁerno para siempre. y que no haya coto a su agonía hasta la última disolución.org/copyleft/. o lo tome prestado y no lo devuelva. If the Document does not specify a version number of this License. Que las polillas roan sus entrañas y. cuando llegue al ﬁnal de su castigo. Each version of the License is given a distinguishing version number. . Que a quien robe este libro. revised versions of the GNU Free Documentation License from time to time. you have the option of following the terms and conditions either of that speciﬁed version or of any later version that has been published (not as a draft) by the Free Software Foundation. Que languidezca de dolor gritando por piedad. se le convierta en una serpiente en las manos y lo venza.

vi Contents .

Thus the majority of the problems are taken from well-known competitions: AHSME AIME USAMO IMO ITT MMPC (UM)2 S TANFORD M ANDELBROT American High School Mathematics Examination American Invitational Mathematics Examination United States Mathematical Olympiad International Mathematical Olympiad International Tournament of Towns Michigan Mathematics Prize Competition University of Michigan Mathematics Competition Stanford Mathematics Competition Mandelbrot Competition Firstly. Due to time constraints. The reader not knowing Calculus can skip these problems. David A.Preface These notes started in the summer of 1993 when I was teaching Number Theory at the Center for Talented Youth Summer Program at the Johns Hopkins University. and the geometry of numbers. SANTOS dsantos@ccp. Most of the motivation was done in the classroom. I hope some day to be able to give more coherence to these notes. and Victor Yang. Here and there some of the problems might use certain properties of the complex numbers. David Ripley. The pupils were between 13 and 16 years of age. these notes are rather sketchy. Nikhil Garg. diophantine equations. No theme requires the knowledge of Calculus here. I tried to cover most Number Theory that is useful in contests. Nathaniel Wise and Andrew Wong. I shall ﬁnish writing them when laziness leaves my weary soul. I also wrote notes (which I have not transcribed) dealing with primitive roots. Masha Sapper. Matthew Harris. Andrew Trister. Nathan Lutchansky. I would be very glad to hear any comments. Eduardo Rozo. but some of the solutions given use it here and there.edu vii . Ryan Hoegg. The purpose of the course was to familiarise the pupils with contest-type problem solving. Since the material is geared to High School students (talented ones. quadratic reciprocity. and please forward me any corrections or remarks on the material herein. Hobart Lee. A note on the topic selection. and Carlos Murillo for proofreading the notes. I would like to thank the pioneers in that course: Samuel Chong. I would like to thank Eric Friedman for helping me with the typing. Howard Bernstein. I would also like to thank the victims of the summer 1994: Karen Acquista. in the notes I presented a rather terse account of the solutions. though) I assume very little mathematical knowledge beyond Algebra and Trigonometry. Geoffrey Cook.

As an example of the use of the Well-Ordering Axiom. 3. addition and multiplication. counting sheep. One further property of the natural numbers is the following.Chapter 1 Preliminaries 1.2 Well-Ordering The set N = {0. Distributive law: a(b + c) = ab + ac. 2 Example Prove that there is no integer in the interval ]0. are very hard to solve. Number Theory is one of the oldest and most beautiful branches of Mathematics. It abounds in problems that yet simple to state. Associative laws: (a + b) + c = a + (b + c) and a(bc) = (ab)c. 1 Axiom (Well-Ordering Axiom) Every non-empty subset S of the natural numbers has a least element. 1 . Some number-theoretic problems that are yet unsolved are: 1. 1. Additive Identity: 0 + a = a + 0 = a 5. Is there always a prime between two consecutive squares of integers? In this chapter we cover some preliminary tools we need before embarking into the core of Number Theory. 2.} of natural numbers is endowed with two operations. 4. 1[. 3. b. . Are there inﬁnitely many primes that are 1 more than the square of an integer? 4. that satisfy the following properties for natural numbers a. who has been drawn to them either for their utility at solving practical problems (like those of measuring. Closure: a + b and ab are also natural numbers.) or as a fountain of solace. 1. let us prove that there is no integer between 0 and 1. 4. (Goldbach’s Conjecture) Is every even integer greater than 2 the sum of distinct primes? 2. (Twin Prime Problem) Are there inﬁnitely many primes p such that p + 2 is also a prime? 3. etc. . and c: 1. 2. .1 Introduction We can say that no history of mankind would ever be complete without a history of Mathematics. For ages numbers have fascinated Man. Multiplicative Identity: 1a = a1 = a.

This implies b that the set √ √ A = {n 2 : both n and n 2 positive integers} √ √ is nonempty since it contains a. then is a perfect square. where b = 0. . But clearly max(a1 . c). say j = k 2. and so a6 + 2b6 = 4c6 . Z = {. Now. a = 2a1 . Hence b = 2b1 and so 1 16a6 + 32b6 = c6 . 3 Example Prove that √ 2 is irrational. Now. 3. Let b1 . and so m2 ∈ S . c1 ) < max(a. i. a2 + b2 − k(ab + 1) = 0 is a quadratic in b with sum of the roots ka and product of the roots a2 − k. As 2 − 1 > 0. b. b) as small as 1 + ab possible. b b . Being a set of positive integers. 1[ is non-empty. 1 + ab 1 + ab a2 + b2 = k is a counterexample of an integer which is not a perfect square. supposing b1 < 0 is incompatible with a2 + b2 = k(ab1 + 1). 2. b. Choose a triplet of nonnegative integers a. b1 . k are positive integers. As k is not a perfect square. An irrational number is a number which cannot be expressed as the ratio of two integers. so b1 + b = ka and b1 b = a2 − k. Suppose that 2 were rational. By Well-Ordering A has a smallest element. 5 Example (IMO 1988) If a. Solution: Clearly we can restrict ourselves to nonnegative numbers. Also b1 = a2 − k b2 − k < < b. Let us give an example of an irrational number. This leads to 32a6 + b6 = 2c6 . We denote the set of all integers by Z. a perfect square. b. we see that √ √ √ ( j − k) 2 = k(2 − 2) < k( 2) = j. a A rational number is a number which can be expressed as the ratio of two integers a. 0. b are positive integers such that a2 + b2 a2 + b2 is an integer. We may assume without loss of generality that a < b for if a = b then Solution: Suppose that 0<k= 2a2 < 2. .e. 4 Example Let a. ﬁnishes the proof. i. This contradicts the choice of j as the smallest integer in A and hence. c be integers such that a6 + 2b6 = 4c6 . c satisfying this equation and with max(a. c) > 0 as small as possible. √ Thus ( j − k) 2 is a positive integer in A which is smaller than j. Show that a = b = c = 0. √ √ a Solution: The proof is by contradiction. We denote the set of b rational numbers by Q. it must contain a least element. 1 supposing b1 = 0 is incompatible with a2 + 02 = k(0 · a + 1).. . −2. a2 + 1 which forces k = 1. − 3. As a. −1.2 Chapter 1 Solution: Assume to the contrary that the set S of integers in ]0. This is a contradiction and so S = ∅. b.}. . This means that all of 1 1 1 1 1 these must be zero. b. that 2 = for some integers a. . Since 2 < 2 2 implies 2 − 2 < 2 and also j 2 = 2k. If a6 + 2b6 = 4c6 then a must be even. with max(a. 1. But this is saying that S has a positive integer m2 which is smaller than its least positive integer m. This gives c = 2c1 . 0 < m2 < m < 1. b. say m. b be its roots.e.. √ √ √ √ j( 2 − 1) = j 2 − k 2 = ( j − k) 2 √ √ √ √ is a positive integer.

. then we should be able to ﬁnish it (because starting with the base case we go to the next case. . We will now derive the Principle of Mathematical Induction from the Well-Ordering Axiom. then A contains all the positive integers greater than or equal to m. assume that 33n − 26n − 1 = 169N for some integer N. Observe that k > 0. n. . Suppose that these steps must be followed in strict numerical order. where n > m. and then to the case following that. 7 Corollary If a set A of positive integers contains the integer m and also contains n + 1 whenever it contains n. 1.1 Find all integer solutions of a3 + 2b3 = 4c3 . u The following versions of the Principle of Mathematical Induction should now be obvious.2. by the Well-Ordering Principle there exists a least positive integer k not in S .) Then we try to settle whether information on P(n − 1) leads to favourable information on P(n). Suppose that we are to perform a task that involves a certain number of steps. i. then S = N.). suppose that we know how to perform the n-th task provided we have accomplished the n − 1-th task. Thus if we are ever able to start the job (that is. Hence k = k − 1 + 1 is also in the set. if we have a base case). a contradiction. But by assumption k − 1 + 1 is also in S . As k − 1 < k. since 0 ∈ S and there is no positive integer smaller than 0. Solution: For n = 1 we are asserting that 36 − 53 = 676 = 169 · 4 is divisible by 169. This 1 + ab1 is a contradiction. Then 33n+3 − 26n − 27 = 27 · 33n − 26n − 27 = 27(33n − 26n − 1) + 676n .3 Mathematical Induction The Principle of Mathematical Induction is based on the following fairly intuitive observation. . we try to verify that some assertion P(n) concerning natural numbers is true for some base case k0 (usually k0 = 1. Thus we have found another positive integer b1 for which Practice Problem 1. n > 1. that k is a perfect square. etc. z only when x = y = z = 0. b). Thus S = N. We shall now give some examples of the use of induction. and also contains the integer n + 1 whenever it contains the integer n. Finally. Proof: Assume this is not the case and so. Assume the assertion is true for n − 1. . where n > m. but one of the examples below shows that we may take. then A contains all the positive integers greater than or equal to m.e. Problem 1. we see that k − 1 ∈ S . say k0 = 33. y. m + 2. which is evident. 9 Example Prove that the expression 33n+3 − 26n − 27 is a multiple of 169 for all natural numbers n.2 Prove that the equality x2 + y2 + z2 = 2xyz can hold for whole numbers x.Practice 3 a2 + b2 1 = k and which is smaller than the smallest max(a. 8 Corollary (Principle of Strong Mathematical Induction) If a set A of positive integers contains the integer m and also contains n + 1 whenever it contains m + 1. It must be the case. Thus in the Principle of Mathematical Induction. since the successor of each element in the set is also in the set. 6 Theorem (Principle of Mathematical Induction) If a setS of non-negative integers contains the integer 0. then.2.

Assume that 2n+2 |k2 − 1. assume that √ √ (1 + 2)2(n−1) + (1 − 2)2(n−1) = 2N for some integer N and that √ √ √ (1 + 2)2(n−1) − (1 − 2)2(n−1) = a 2 for some positive integer a. Solution: The statement is evident for n = 1. and √ √ √ (1 + 2)2 − (1 − 2)2 = 4 2. Using P(n − 1). This simpliﬁes to √ √ √ √ (3 + 2 2)(1 + 2)2n−2 + (3 − 2 2)(1 − 2)2n−2 . and let us prove that n n n+1 n+1 2n+3 |k2 − 1. 10 Example Prove that Chapter 1 √ √ (1 + 2)2n + (1 − 2)2n √ √ √ (1 + 2)2n − (1 − 2)2n = b 2 is an even integer and that for some positive integer b. then we see that √ √ (1 + 2)2 + (1 − 2)2 = 6. The assertion is thus established by induction. the above simpliﬁes to an even integer and similarly √ √ √ √ √ (1 + 2)2n − (1 − 2)2n = 3a 2 + 2 2(2N) = (3a + 4N) 2. an even integer. as k2 − 1 = (k − 1)(k + 1) is divisible by 8 for any odd natural number k because n both (k − 1) and (k + 1) are divisible by 2 and one of them is divisible by 4. The assertion is thus established by induction. Therefore P(1) is true. As k2 − 1 = (k2 − 1)(k2 + 1). n . so the problem reduces to proving that 2|(k2n + 1). i. 11 Example Prove that if k is odd.” If n = 1.e. This is obviously true since k2n odd makes k2n + 1 even.. which is divisible by 169. √ √ 12N + 2 2a 2 = 2(6N + 2a). and so P(n) is true. Consider now the quantity √ √ √ √ √ √ (1 + 2)2n + (1 − 2)2n = (1 + 2)2 (1 + 2)2n−2 + (1 − 2)2 (1 − 2)2n−2 . then 2n+2 divides k2 − 1 for all natural numbers n.4 which reduces to 27 · 169N + 169 · 4n. for all integers n ≥ 1. Assume that P(n − 1) is true for n > 1. we see that 2n+2 divides (k2n − 1). Let P(n) be the proposition: “(1 + 2)2n + (1 − 2)2n is even and (1 + 2)2n − (1 − √ √ 2n 2) = b 2 for some b ∈ N. √ √ √ Solution: We proceed by induction on n.

Assume that the Arithmetic-Mean-GeometricMean Inequality holds true for n = 2k−1 . assume that nonnegative real numbers w1 . k > 2. x2 = 2 +1 k−1 2 Upon expanding. We now present a variant of the Principle of Mathematical Induction used by Cauchy to prove the Arithmetic-MeanGeometric Mean Inequality. But (??) implies the truth of P(n + 1) whenever P(n) is true. . that is.Mathematical Induction 12 Example (USAMO 1978) An integer n will be called good if we can write 5 n = a1 + a2 + · · · + ak . w2 . 13 Theorem (Arithmetic-Mean-Geometric-Mean Inequality) Let a1 . k−1 2 Using (??) with y1 + y2 + · · · + y2k−1 x1 = 2k−1 and y k−1 + · · · + y2k . . if n is good both 2n + 8 and 2n + 9 are good. a2 . x1 + x2 √ (1. an be nonnegative real numbers. . By the statement of the problem. . we see that P(33) is true. a1 a2 · · · an ≤ n Proof: Since the square of any real number is nonnegative. 2a1 2a2 2ak 4 4 2 4 4 Also. . 2n + 9 = 2a1 + 2a2 + · · · + 2ak + 3 + 6 and 1 1 1 1 1 1 1 1 + + ···+ + + = + + = 1. . Solution: We ﬁrst prove that if n is good. w2k−1 satisfy k−1 w1 + w2 + · · · + w2k−1 (1. Then 1 1 1 + + ··· + . (1. . For assume that n = a1 + a2 + · · · + ak . where a1 . .3) ≥ (w1 w2 · · · w2k−1 )1/2 . a1 a2 ak Given the information that the integers 33 through 73 are good. . . .2) ≥ x1 x2 . ak are positive integers (not necessarily distinct) satisfying 1 1 1 + + · · · + = 1. n + 1. prove that every integer ≥ 33 is good. then 2n + 8 and 2n + 9 are good. Let P(n) be the proposition “all the integers n. . 2 which is the Arithmetic-Mean-Geometric-Mean Inequality for n = 2. and 1= Then 2n + 8 = 2a1 + 2a2 + · · · + 2ak + 4 + 4 and 1 1 1 1 1 1 1 1 + + ···+ + + = + + = 1. It consists in proving a statement ﬁrst for powers of 2 and then interpolating between powers of 2. n + 2. . . The assertion is thus proved by induction. 2a1 2a2 2ak 3 6 2 3 6 Therefore. a1 a2 ak √ a1 + a2 + · · · + an n . a2 .1) We now establish the truth of the assertion of the problem by induction on n. . we have √ √ ( x1 − x2 )2 ≥ 0.. . 2n + 7” are good.

and yn+1 = yn+2 = · · · = y2k = Let A= Using (??) we obtain a1 + a2 + · · · + an + (2k − n) 2k a1 + · · · + an n a1 + a2 + · · · + an . all powers of 2 belong to M . 2. say a. Since 1 belongs to M so does 4. then there is nothing to prove. .. and so we have proved the Arithmetic-Mean-GeometricMean Inequality for powers of 2. In conclusion. yn = a n . . n 14 Example Let s be a positive integer. Prove √ that M is the set of all natural numbers. . Hence s < 2r+1 < 2s. Now. This means that 1 belongs to M . i. Thus all the powers of 2 raised to an even power belong to M . By assumption a < a unless a = 1. If s is not a power of 2 then it must lie between two consecutive powers of 2. )( ) ( 2k−1 2k−1 Chapter 1 Applying (??) to both factors on the right hand side of the above . n ≥ a1 a2 · · · an ( a1 + · · · + an (2k −n) ) n 1/2k . but √ Since M is a nonempty set of positive integers. First we will prove that 1 belongs to the set. y2 = a 2 . √ a also belongs to M . n a1 + · · · + an and G = (a1 · · · an )1/n . Solution: If s is a power of 2. it has a least element. .. 2k This translates into A ≥ G or which is what we wanted. etc. since 4 belongs to M so does 4 · 4 = 42 . which is to say that k k nA + (2k − n)A ≥ (Gn A2 −n )1/2 .4) This means that the 2k−1 -th step implies the 2k -th step. This yields 2r+1 < 2s. there is an integer r for which 2r < s < 2r+1 . . n = 1. belong to M . . In this way we obtain that all numbers of the form 4n = 22n . Prove that every interval [s. we obtain k y1 + y2 + · · · + y2 k ≥ (y1 y2 · · · y2k )1/2 .u (a1 a2 · · · an )1/n ≤ a1 + a2 + · · · + an . 15 Example Let M be a nonempty set of positive integers such that 4x and [ x] both belong to M whenever x does. which gives the required result.6 we obtain that y1 + y2 + · · · + y2k−1 y2k−1 +1 + · · · + y2k + 2k−1 2k−1 ≥ 2 ã Å y1 + y2 + · · · + y2k−1 y2k−1 +1 + · · · + y2k 1/2 . 2s] contains a power of 2. . secondly we will prove that every power of 2 is in the set and ﬁnally we will prove that non-powers of 2 are also in the set. assume that 2k−1 < n < 2k . . Let y1 = a 1 . Solution: We will prove this by induction.e. k 2 (1. Since the square roots belong as well to M we get that all the powers of 2 raised to an odd power also belong to M .

Since the function f: R x is decreasing. (n + 1)2 ) belongs to M .7 Prove that if n is a natural number. .Practice 7 Assume now that n ∈ N fails to belong to M . Problem 1.3. 2n2 ] is totally contained in [n2 .2 Prove that 1− x x(x − 1) x(x − 1)(x − 2) + − 1! 2! 3! x(x − 1)(x − 2) · · ·(x − n + 1) n! Problem 1. Prove that 1 · 3 · 5 · · ·(2n − 1) 1 . Thus the interval [n2 . k k k k k k Practice Problem 1. Observe that n cannot be a power of 2.3. Prove the inequality 1 1 1 + + ···+ > 1. (n + 1)2 ) belongs to M .8 Prove that if n is a natural number. n(4n2 − 1) . for all natural numbers n.3.3.3 Let n ∈ N. Problem 1. By induction we can r r show that no member in the interval Ar = [n2 . 2s] where s is a positive integer contains a power of 2. Similarly no member z ∈ A2 = [n4 . The function f: ∗ R+ x → R → log2 x → R∗ + → 2−x is increasing and hence log2 (n + 1) − log2 n > 0.10 Prove that the sum of the cubes of three consecutive positive integers is divisible by 9. (n + 1)4 ) belongs to M since this would entail that z would belong to A1 .6 Let n ∈ N. then 1 · 2 + 2 · 5 + · · ·+ n · (3n − 1) = n2 (n + 1). (n + 1)2 ). a contradiction.5 Let a1 = 3. But every interval of the form [s.3.3. thereby obtaining a contradiction to the hypothesis that no element of the Ar belonged to M . n > 1.1 Prove that 11n+2 + 122n+1 is divisible by 133 Problem 1. We have thus obtained the desired contradiction. b1 = 4. Problem 1. then 12 + 32 + 52 + · · · + (2n − 1)2 = Problem 1. Problem 1. We will now show that eventually these intervals are so large that they contain a power of 2.4 Prove that » √ π 2 + 2 + · · · + 2 = 2 cos n+1 2 n radical signs for n ∈ N. Prove that a1000 > b999 . because every member of y ∈ A1 satisﬁes [ y] = n.3. and an = 3an−1 . bn = 4bn−1 when n > 1. <√ 2 · 4 · 6 · · ·(2n) 3n + 1 Problem 1.9 Prove that (2n)! 4n < n + 1 (n!)2 for all natural numbers n > 1. 3 + · · · + (−1)n equals (−1) n (x − 1)(x − 2) · · ·(x − n) n! for all non-negative integers n.3. for a sufﬁciently large positive integer k we have 2−k < log2 (n + 1) − log2 n. Since n ∈ M we deduce that √ no integer in A1 = [n2 . n+1 n+2 3n + 1 Problem 1.3. This implies that (n + 1)2 > 2n2 .3.

8 Problem 1.3.11 If |x| = 1, n ∈ N prove that 1 4 8 2n 2 + + + ···+ + n 2 2 8 1+x 1+x 1+x 1+x 1 + x2 equals 1 2n+1 . + x − 1 1 − x2n+1 Problem 1.3.12 Is it true that for every natural number n the quantity n2 + n + 41 is a prime? Prove or disprove! Problem 1.3.13 Give an example of an assertion which is not true for any positive integer, yet for which the induction step holds. Problem 1.3.14 Give an example of an assertion which is true for the ﬁrst two million positive integers but fails for every integer greater than 2000000. Problem 1.3.15 Prove by induction on n that a set having n elements has exactly 2n subsets. Problem 1.3.16 Prove that if n is a natural number, n5 /5 + n4/2 + n3/3 − n/30 is always an integer. (n − 1) 3. Prove that if n > 1, then 1 · 3 · 5 · · ·(2n − 1) < nn .

Chapter 1

5. Prove that if n > 1 then

4. Prove that if n > 1 then Ä ä 1 1 n (n + 1)1/n − 1 < 1 + + · · · + . 2 n

7. Let y1 , y2 , . . . , yn be positive real numbers. Prove the Harmonic-Mean- Geometric-Mean Inequality: n √ ≤ n y1 y2 · · · yn . 1 1 1 + + ···+ y1 y2 yn

6. Given that u, v, w are positive, 0 < a ≤ 1, and that u + v + w = 1, prove that Å ãÅ ãÅ ã 1 1 1 −a −a − a ≥ 27 − 27a + 9a2 − a3 . u v w

Å ã 1 1 1 1 . 1 + + ···+ < n 1 − + 2 n (n + 1)1/n n + 1

8. Let a1 , . . . , an be positive real numbers, all different. Set s = a1 + a2 + · · · + an . (a) Prove that 1 < s − ar 1 . ar

1≤r≤n 1≤r≤n Problem 1.3.17 (Halmos) ) Every man in a village knows instantly when another’s wife is unfaithful, but never when his (b) Deduce that own is. Each man is completely intelligent and knows that ev4n n 1 1 ery other man is. The law of the village demands that when . <s < s ar (s − ar ) n − 1 ar a man can PROVE that his wife has been unfaithful, he must 1≤r≤n 1≤r≤n shoot her before sundown the same day. Every man is completely law-abiding. One day the mayor announces that there Problem 1.3.19 Suppose that x1 , x2 , . . . , xn are nonnegative is at least one unfaithful wife in the village. The mayor always real numbers with tells the truth, and every man believes him. If in fact there are exactly forty unfaithful wives in the village (but that fact x1 + x2 + · · · + xn ≤ 1/2. is not known to the men,) what will happen after the mayor’s Prove that announcement?

Problem 1.3.18 bers with

1. Let a1 , a2 , . . . an be positive real numa1 · a2 · · · an = 1.

(1 − x1)(1 − x2 ) · · · (1 − xn) ≥ 1/2. Problem 1.3.20 Given a positive integer n prove that there is a polynomial Tn such that cos nx = Tn (cos x) for all real numbers x. Tn is called the n-th Tchebychev Polynomial. Problem 1.3.21 Prove that 1 1 13 1 + + ···+ > n+1 n+2 2n 24 for all natural numbers n > 1.

Use induction to prove that a1 + a2 + · · · + an ≥ n, with equality if and only if a1 = a2 = · · · = an = 1. 2. Use the preceding part to give another proof of the Arithmetic-Mean-Geometric-Mean Inequality.

Fibonacci Numbers

9

Problem 1.3.22 In how many regions will a sphere be divided Problem 1.3.24 Let F0 (x) = x, F(x) = 4x(1 − x), Fn+1 (x) = by n planes passing through its centre if no three planes pass F(Fn (x)), n = 0, 1, . . . . Prove that through one and the same diameter?

1

Problem 1.3.23 (IMO 1977) Let f , f : N → N be a function satisfying f (n + 1) > f ( f (n)) for each positive integer n. Prove that f (n) = n for each n.

Fn (x) dx =

0

22n−1 . 22n − 1

(Hint: Let x = sin2 θ .)

1.4

Fibonacci Numbers

f0 = 0, f1 = 1, fn+1 = fn−1 + fn , n ≥ 1. (1.5)

The Fibonacci numbers fn are given by the recurrence

Thus the ﬁrst few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, . . . . A number of interesting algebraic identities can be proved using the above recursion.

16 Example Prove that

**f1 + f2 + · · · + fn = fn+2 − 1. Solution: We have f1 f2 f3 . . . fn Summing both columns, f1 + f2 + · · · + fn = fn+2 − f2 = fn+2 − 1, as desired.
**

17 Example Prove that

= f3 − f2 = f4 − f3 = f5 − f4 . . . = fn+2 − fn+1

**f1 + f3 + f5 + · · · + f2n−1 = f2n . Solution: Observe that f1 f3 f5 . . . f2n−1 Adding columnwise we obtain the desired identity.
**

18 Example Prove that

2 2 2 f1 + f2 + · · · + fn = fn fn+1 .

= = = . . . =

f2 − f0 f4 − f2 f6 − f4 . . . f2n − f2n−2

Solution: We have

2 fn−1 fn+1 = ( fn+1 − fn )( fn + fn−1 ) = fn+1 fn − fn + fn+1 fn−1 − fn fn−1 .

Thus

2 fn+1 fn − fn fn−1 = fn ,

10 which yields

2 2 2 f1 + f2 + · · · + fn = fn fn+1 .

Chapter 1

**19 Theorem (Cassini’s Identity)
**

2 fn−1 fn+1 − fn = (−1)n , n ≥ 1.

Proof: Observe that

2 fn−1 fn+1 − fn

= = =

2 ( fn − fn−2 )( fn + fn−1 ) − fn − fn−2 fn − fn−1 ( fn−2 − fn ) 2 −( fn−2 fn − fn−1 )

2 Thus if vn = fn−1 fn+1 − fn , we have vn = −vn−1 . This yields vn = (−1)n−1 v1 which is to say 2 2 fn−1 fn+1 − fn = (−1)n−1 ( f0 f2 − f1 ) = (−1)n .

u

20 Example (IMO 1981) Determine the maximum value of

m2 + n 2 , where m, n are positive integers satisfying m, n ∈ {1, 2, 3, . . . , 1981} and (n2 − mn − m2)2 = 1. Solution: Call a pair (n, m) admissible if m, n ∈ {1, 2, . . . , 1981} and (n2 − mn − m2)2 = 1. If m = 1, then (1, 1) and (2, 1) are the only admissible pairs. Suppose now that the pair (n1 , n2 ) is admissible, with n2 > 1. 2 As n1 (n1 − n2) = n2 ± 1 > 0, we must have n1 > n2 . Let now n3 = n1 − n2 . Then 1 = (n2 − n1 n2 − n2 )2 = (n2 − n2 n3 − n2 )2 , making (n2 , n3 ) also admissible. If n3 > 1, in the 1 2 2 3 same way we conclude that n2 > n3 and we can let n4 = n2 − n3 making (n3 , n4 ) an admissible pair. We have a sequence of positive integers n1 > n2 > . . ., which must necessarily terminate. This terminates when nk = 1 for some k. Since (nk−1 , 1) is admissible, we must have nk−1 = 2. The sequence goes thus 1, 2, 3, 5, 8, . . ., 987, 1597, i.e., a truncated Fibonacci sequence. The largest admissible pair is thus (1597, 987) and so the maximum sought is 15972 + 9872. √ √ 1+ 5 5−1 −1 be the Golden Ratio. Observe that τ = . The number τ is a root of the quadratic equation Let τ = 2 2 2 x = x + 1. We now obtain a closed formula for fn . We need the following lemma.

21 Lemma If x2 = x + 1, n ≥ 2 then we have xn = fn x + fn−1 .

Proof: We prove this by induction on n. For n = 2 the assertion is a triviality. Assume that n > 2 and that xn−1 = fn−1 x + fn−2 . Then xn = xn−1 · x = ( fn−1 x + fn−2 )x = fn−1 (x + 1) + fn−2x = ( fn−1 + fn−2 )x + fn−1 = fn x + fn−1 u

22 Theorem (Binet’s Formula) The n-th Fibonacci number is given by

1 fn = √ 5 n = 0, 2, . . . .

ÇÇ

√ ån Ç √ ån å 1+ 5 1− 5 − 2 2

For s = 1 we are asking whether ft+1 = f0 ft + f1 ft+1 . = fs−2 ft + fs−1 ft+1 + fs−3 ft + fs−2 ft+1 by the inductive assumption = ft ( fs−2 + fs−3 ) + ft+1 ( fs−1 + fs−2 ) rearranging.t ≥ 0 are integers then fs+t = fs−1 ft + fs ft+1 . In virtue of the above lemma. Assume that s > 1 and that fs−k+t = fs−k−1 ft + fs−k ft+1 for all k satisfying 1 ≤ k ≤ s − 1. Proof: We keep t ﬁxed and prove this by using strong induction on s. 5 n As τ 2 = τ + 1. τ n − (1 − τ )n = √ 5 fn . Solution: Using Binet’s Formula. 1 + 2τ = τ 3 . Similarly 1 + 2(1 − τ ) = (1 − τ )3 . Thus n Ç å ä n k 1 Ä 2 fk = √ (τ )3n + (1 − τ )3n = f3n . 24 Theorem If s ≥ 1. = ft fs−1 + ft+1 fs by the Fibonacci recursion. k 5 k=0 as wanted. We have fs+t = fs+t−1 + fs+t−2 by the Fibonacci recursion.Practice √ √ 1+ 5 1− 5 and 1 − τ = .u 23 Example (Cesàro) Prove that n k=0 (1 − τ )n = (1 − τ ) fn + fn−1 . = fs−1+t + fs−2+t trivially.u Practice . n k=0 Ç å n k 2 fk = f3n . This ﬁnishes the proof. k Ç å n k 2 fk k = = = Ç å n k τ k − (1 − τ )k √ 2 k 5 k=0 n Ç å n Ç å n k n k 1 √ τ − 2 (1 − τ )k k 5 k=0 k k=0 1 n √ ((1 + 2τ ) − (1 + 2(1 − τ ))n) . The following theorem will be used later. Proof: The roots of the equation x = x + 1 are τ = 2 2 2 11 τ n = τ fn + fn−1 and Subtracting from where Binet’s Formula follows. which is trivially true.

4.16 Prove that fn 10n Hint: What is 1 fn−1 fn − 1 ? fn fn+1 is a rational number.4. .9 Prove that ∞ n=1 fn = 1. n n→∞ τ 5 lim Problem 1.4.2 Prove that 2 2 fn+1 = 4 fn fn−1 + fn−2 . k 1/ f2n = 4 − τ . n > 2. Problem 1.8 Prove that ∞ n=2 1 = 1. n=0 Problem 1. then there is an integer n such that k = ± fn . f 2k f 2n √ 1 7− 5 = .4. 2 fn − fn+l fn−l = (−1)n+l fl2 .5 Prove that 2 2 fn + fn−1 n→∞ Problem 1.6 Prove that if n > 1.4. Problem 1.18 Prove the converse of Cassini’s Identity: If k and m are integers such that |m2 − km − k2 | = 1. Prove that the largest n such that fn ≤ N is given by Å ã 1 √ log N + 5 2 Ç √ å .4.4 Let N be a natural number. k ∞ n=1 Problem 1.13 Prove that lim fn+r = τr. Problem 1. Deduce that ∞ k=0 Problem 1. fn−1 fn+1 Ç å n fk = f2n . m = ± fn+1 .4.4.15 (Cesàro) Prove that (n − k) f2k+1 .11 Prove that ∞ arctan n=1 1 = π /4. f2n −2 1 = 2+ .4.4.1 Prove that fn+1 fn − fn−1 fn−2 = f2n−1 . Chapter 1 Problem 1. fn Problem 1. n k=0 f2k = k=1 k=0 Problem 1. n= 1+ 5 log 2 Problem 1.4.3 Prove that 2 f1 f2 + f2 f3 + · · · + f2n−1 f2n = f2n . fn+1 fn+2 (−1) k=1 k Problem 1.14 Prove that n k=0 = f2n+1 . f 2k 2 Problem 1.10 Prove that ∞ Ç å 1995 fk .4.7 Prove that n n Problem 1.4.12 Prove that fn 1 =√ .17 Find the exact value of 1994 Problem 1.4. f2n+1 Problem 1.12 Problem 1.4.4.4. n > 1.4.

5. which add to 104. Solution: First observe that if we choose n + 1 integers from any string of 2n consecutive integers. . {52}. 126} into the six sets {1. 55}. . {31. 3. . .. there must be two that differ by 10... {7. 61. which satisfy b < a ≤ 2b. . . there must be two that belong to the same group. 29. {a + 2. . {4. . From that group. {61. one can ﬁnd two of them. Solution: There are 210 − 1 = 1023 non-empty subsets that one can form with a given 10-element set. . 100}. . and obviously... Therefore. . {49. . 32.. {a + 1. prove that one must select some two that differ by 10. we must perforce choose eleven from some group. 16.. 2. 94}. So now group the one hundred integers as follows: {1. . . a + n + 1}. Prove that there must be two distinct integers in A whose sum is 104.. 8. 4.. . there will always be some two that differ by n. . by the above observation (let n = 10).20}. . This apparently trivial principle is very powerful. 126}. {3. 62} and {63. . 82. . 60}. . {41. If we select ﬁfty ﬁve integers. . . . 2. . . . 100. . .. .. a + 3. 40}.Pigeonhole Principle 13 1. a + n + 2}. . . . 100} . Let us see some examples. 22. . Solution: We partition the thirty four elements of this progression into nineteen groups {1}.. by the Pigeonhole Principle there must be two integers that belong to one of the pairs. . By the Pigeonhole Principle. 6}. 25 Example (Putnam 1978) Let A be any set of twenty integers chosen from the arithmetic progression 1. 62. 80} and {81. prove that there are two disjoint nonempty subsets of the set with equal sums of their elements. 28 Example No matter which ﬁfty ﬁve integers may be selected from {1. . 4. . 2. . any such two will satisfy the stated inequality. 27 Example Given any set of ten natural numbers between 1 and 99 inclusive. {a + n. {21. 2}. . say a and b. {10. 64. a + 2n}. 42. . Solution: Split the numbers {1. {15. . . {7. . a + 2n} into the n pairs and if n + 1 integers are chosen from this. 13. two of the seven numbers must lie in one of the six sets. . there must be a pigeonhole containing at least two pigeons.5 Pigeonhole Principle The Pigeonhole Principle states that if n + 1 pigeons ﬂy to n holes. 14}. there must be at least two different subsets that have the same sum. . 26 Example Show that amongst any seven distinct positive integers not exceeding 126. This is because we can pair the 2n consecutive integers {a + 1. . 97}. The maximum value that any such sum can achieve is 90 + 91 + · · · + 99 = 945 < 1023. 30}. . . 100}. Since we are choosing twenty integers and we have nineteen sets. a + 2. To each of these subsets we associate the sum of its elements.

By the Pigeonhole Principle. Charlie must write to at least six of the people of one topic. and we are done again. a6 . we obtain 0 < tan(a j − ai ) = tan a j − tan ai 1 π < tan = √ . . If a1 = a1 + a2 = a1 + a2 + a3 = a2 + a3 + a4 = a3 + a4 + a5 = a4 + a5 + a6 = a5 + a6 + a7 = a7 = 1/3. . . Otherwise. . 1/3). . then Eric and this pair correspond on topic II. Then 0 < a j − ai < . and we are done. a3 . say topic II. 31 Example Given any seven distinct real numbers x1 . x7 . . a2 . 1 + ab 3 Solution: Put xk = tan ak for ak satisfying − π π π π < ak < . These nine quantities then average 3/9 = 1/3. we obtain the 7-tuple (a1 . ﬁfty discs ‘‘50”. M ≥ 1/3. By the Pigeonhole Principle. π /2). . a4 . “9” and any nine from each of the discs “10”. three discs “3”. these six correspond amongst themselves only on topics II or III. Solution: Since a1 ≤ a1 + a2 ≤ a1 + a2 + a3 and a7 ≤ a6 + a7 ≤ a5 + a6 + a7 we see that M also equals 1≤k≤5 max {a1 . 0. and we are done. . say topic I. + a7 = 1. What is the minimum number of discs that must me drawn in order to guarantee drawing at least ten discs with the same label? Solution: If we draw all the 1 + 2 + · · · + 9 = 45 labelled “1”. ak + ak+1 + ak+2 }. .e. we have drawn 45 + 9 · 41 = 414 discs. a7 ) = (1/3. say ai < a j . “50”. Solution: Choose a particular person of the group.14 Chapter 1 29 Example (AHSME 1994) Label one disc “1”. 1 + tana j tan ai 6 3 as desired. 0. The 415-th disc drawn will assure at least ten discs from a label. We are thus taking the maximum over nine quantities that sum 3(a1 + a2 + · · · + a7 ) = 3. a7 be nonnegative real numbers with a1 + a2 + . 0. . ) into six non-overlapping subintervals of 2 2 2 2 π equal length. prove that we can always ﬁnd two. . By the Pigeonhole Principle. If M = max ak + ak+1 + ak+2. a5 . say Charlie. Each pair of correspondents deals with only one of these topics. a6 + a7 . 30 Example (IMO 1964) Seventeen people correspond by mail with one another—each one with all the rest. say Eric. 0. Prove that there at least three people who write to each other about the same topic. there must be three of the ﬁve remaining that correspond with Eric in one of the topics. If any pair of these six people corresponds on topic I. two of seven points will lie on the same interval. . . Choose a particular person from this group of six. a2 . 1≤k≤5 determine the minimum possible value that M can take as the ak vary. . Put these 1 + 2 + 3 + · · ·+ 50 = 1275 labeled discs in a box. . Otherwise. say a. then Charlie and this pair do the trick. these three people only correspond with one another on topic III. which shows that M = 1/3. 32 Example (Canadian Math Olympiad 1981) Let a1 . He corresponds with sixteen others. 6 Since the tangent increases in (−π /2. If amongst these three there is a pair that corresponds with each other on topic II. . . . a1 + a2 . one of these is ≥ 1/3. i. . two discs “2”. Practice . By the Pigeonhole Principle. . In their letters only three different topics are discussed. . b with 0< 1 a−b <√ . Discs are then drawn from the box at random without replacement. Divide the interval (− . a7 . 1/3.

vertices of the same colour.Practice Problem 1.4 Show that in any sum of non-negative real the same colour which are one unit apart. He wants to put his dollars into his pockets so distributed that each pocket contains a different number of dollars. Problem 1.13 Let r1 . 2n − 1}. . What is the minimum number of people in the party who know everyone else? . or a decreasing sequence with at least m + 1 Problem 1.8 No matter which ﬁfty ﬁve integers may be selected from {1.12 Let r1 . Show that there are numbers εk . a square √ side 1. 100}.5. . 2 k=1 εk rk ≤ n . . such that tive consonants. 1982) In a party with 1982 persons. .9 Let mn + 1 different real numbers be given. amongst any group of four there is at least one person who knows each of the other three.5. 1 ≤ k ≤ n. Give an example in which any subsum has abso1 Problem 1.Problem 1.5. 15 Problem 1. 2n − 1} of n + 1 el. prove that there are at least three of the mathematicians who can speak the same language.5. numbers there is always one number which is at least the average of the numbers and that there is always one member that Problem 1.5. .5. English alphabet are listed in an arbitrary order. in a room there are at least three who know one another. . some two that differ by 10. some two that differ by 12.11 Show that if the points of the plane are it is at most the average of the numbers. n > 1 be real numbers of abements is sum free. . . Problem 1. Show that is not sum free. . The problem is most interesting when n= Why? (p − 1)(p − 2) . rn .colours for which no equilateral triangle of side 1 has all its mum size of a sum free subset of {1. distance 2/2. 0. at least two speak a common language. prove that you must select some two that differ by 9. 1].5.5. Show that any subset with n + 2 elements solute value not exceeding 1 and whose sum is 0. Generalise the problem. Problem 1. there is a non-empty proper subset whose sum is not more than 2/n in size.5. Hint: Observe that the set {n + 1.6 (MMPC 1992) Suppose that the letters of the lute value at least . a colouring of the points of the plane with two the set add up to a third element of the set.5. What is the smallest possible value of N? Answer: 20. εk = 2.2 Show that if any ﬁve points are all in. n−1 1.5. rn be real numbers in the interval [0.7 (Stanford 1953) Bob has ten pockets and forty four silver dollars. Can he do so? 2. Problem 1.5 We call a set “sum free” if no two elements of is. There are N people seated at this table in such a way that the next person to be seated must sit next to someone.14 (USAMO. If each of the mathematicians can speak at most three languages.5. Prove that there must be four consecutive consonants. Give a list to show that there need not be ﬁve consecu−1. 2n Problem 1.10 If the points of the plane are coloured with three colours. . 2. . Suppose that all the letters are arranged in a circle. then some pair of them will be at most at of Problem 1. . . There Problem 1. . . or at least three who do not know one another. n + 2. . there will always exist an equilateral triangle with all its vertices of the same colour. show that there will always exist two points of Problem 1. 1. r2 . r2 .5..5. but that you need not have any two that differ by 11. Problem 1. 1947) Prove that amongst six people members. and some two that differ by 13. .3 (Eötvös. considering p pockets and n dollars. Prove that there is either an increasing sequence with at least n + 1 members. 1 not all zero.1 (AHSME 1991) A circular table has exactly sixty chairs around it. . n 3. 1979) Nine mathematicians meet at an international conference and discover that amongst any three of them. 2. coloured with two colours.5. or on.15 (USAMO. however. What is the maxi. Prove that there must be ﬁve consecutive consonants. .

Any two distinct points of Pn are joined by a straight line segment which is then coloured in one of n given colours. Prove that there are two people such that. Problem 1. at some mon=0 .5.18 Let Pn be a set of en! + 1 points on the plane. ment. of the remaining n − 2 people.) both were sleeping simultaneously. each of ﬁve mathematicians fell asleep exactly twice. each of whom knows both or else knows neither of the two.16 (USAMO. there are at least n/2 − 1 of them. some three were sleeping simultaneously. Show that at least one monochromatic triangle is formed.17 (USAMO. Assume that “knowing” is a symmetrical relationship. 1986) During a certain lecture.5. For each ∞ pair of these mathematicians. 1985) There are n people at a party. Prove that. Chapter 1 Problem 1.16 Problem 1.5. there was some moment when (Hint: e = 1/n!.

17 . This forces n + 1|2 and so n + 1 = 1 or n + 1 = 2. The following properties should be immediate to the reader. Thus am + nb = c(sm + tn). z are integers with x|y. we say that a divides b if there is an integer c such that ac = b. We have 7s = 3x + 2 for some integer s and so 15x2 − 11x − 14 = 7s(5x − 7).tc = b. 36 Example If 7|3x + 2 prove that 7|(15x2 − 11x − 14. Also.The following theorem goes further. 37 Theorem The product of n consecutive integers is divisible by n!. If a. b. If a does not divide b we write a |b. v with xu = y. We write this as a|b.t with sc = a. c|b. 34 Theorem 1. Proof: There are integers s. Solution: Observe that 15x2 − 11x − 14 = (3x + 2)(5x − 7). Hence xuv = z.). so that the only such n is n = 1. y.u 35 Example Find all positive integers n for which n + 1|n2 + 1. yv = z. giving x|z. giving c|(am + bn). Among every two consecutive integers there is an even one. etc. It should be clear that if a|b and b = 0 then 1 ≤ |a| ≤ |b|.1 Divisibility 33 Deﬁnition If a = 0. there are integers u. The choice n + 1 = 1 is out since n ≥ 1. Solution: n2 + 1 = n2 − 1 + 2 = (n − 1)(n + 1) + 2. giving the result. m. b are integers. 2. c. n are integers with c|a. y|z then x|z. If x. then c|(am + nb).Chapter 2 Divisibility 2. among every three consecutive integers there is one divisible by 3.

n2 − 2n? Problem 2.. n9 − 6n7 + 9n5 − 4n3 is divisible by 8640. then the product of them is 0. then the are at least m + 1 nk ’s that are the same. (n!)! is divisible by n!(n−1)! Problem 2.) n2 − 4.2 Prove that n5 − 5n3 + 4n is always divisible by 120. Problem 2.1 Given that 5|(n + 2). . and so there is nothing to prove. . then n divides n is a positive integer. 40 Theorem If k|n then fk | fn . for all integers n. Problem 2. Problem 2.9 (Olimpíada matemática española. the divisibility by n! follows from the fact that binomial coefﬁcients are integers: Ç å m+n (m + n)! (m + n)(m + n − 1) · · ·(m + 1) = = . If no nk is greater than n. 5. . 7. the assertion follows. If all the n consecutive integers are negative. prove that (n + 1)(n + 2) · · · (2n) is divisible by 2n . amn+1 . p + 4. Prove that you can ﬁnd either m + 1 of them no one of which divides any other. n2 + 8n + 7.3 Prove that (2m)!(3n)! (m!)2 (n!)3 is always an integer. because ak |al implies that nk ≥ nl + 1.1.1.18 Chapter 2 Proof: Assume ﬁrst that all the consecutive integers m+ 1. ak+1 . and so we apply the ﬁrst result. .4 Demonstrate that for all integer values n.1. 1985) If Problem 2. or n + 1 of them. Problem 2. Solution: n3 − n = (n − 1)n(n + 1) is the product of 3 consecutive integers and hence is divisible by 3! = 6. If this is so. Solution: Let. and see that the corresponding product is positive.) . nk denote the length of the longest chain.t = n in the identity fs+t = fs−1 ft + fs ft+1 we obtain f(k+1)n = fkn+n = fn−1 fkn + fn fkn+1 . the cases when n is and is not a are divisible by 5 perfect square. n n!m! n! If one of the consecutive integers is 0. Proof: Letting s = kn. n4 − 1. It is clear that if fn | fkn then fn | f(k+1)n . which of the following (Hint: Consider. m+ n are positive. < amn+1 be mn + 1 integers.u Practice Problem 2. each dividing the following.7 Prove that for n ∈ N. the integers ak corresponding to these nk ’s cannot divide each other. Since fn | fn·1 . p + 2.6 Prove that there is no prime triplet of the form p.1. . Problem 2. except for 3. However. separately.1. starting with ak and each dividing the following one. that can be selected from ak . . we multiply by (−1)n .5 Prove that if n > 4 is composite. .1.8 (AIME 1986) What is the largest positive integer n for which (n + 10)|(n3 + 100)? (Hint: x3 + y3 = (x + y)(x2 − xy + y2). for each 1 ≤ k ≤ mn + 1.1. .1. 39 Example (Putnam 1966) Let 0 < a1 < a2 < .1. (n − 1)!.u 38 Example Prove that 6|n3 − n. . m+ 2.

0 ≤ r2 < b. 4. b are positive integers. To show that r and q are unique. . . 16.} is the family of integers of the form 3k − 1. 1253 = 2312 − 1059 = d(q3 − q1 ) and 895 = 2312 − 1417 = d(q3 − q2 ). −3. all these values make the expression divisible by 24. Thus (for example) 1059 = 5 · 179 + 164. −5. Observe that the family 3k + 2. there must be some q ∈ Z such that r = a − bq since r ∈ S . 1417 = q2 d + r. Solution: n2 + 23 = n2 −1 + 24 = (n −1)(n + 1)+ 24. 45 Example Show that if p > 3 is a prime. which means that r = 164. Solution: By the Division Algorithm. 1059 = q1 d + r. 9. But (6k ± 1)2 − 1 = 36k2 ± 12k = 12k(3k − 1). For example. 7. . For assume that r ≥ b. then we say that it is composite. This completes the proof. k ∈ Z and C = {. S has a least element. 1417 and 2312 are divided by d > 1. 8. 44 Deﬁnition A prime number p is a positive integer greater than 1 whose only positive divisors are 1 and p. . k ∈ Z. r ≥ 0. 11. Hence d|358 = 2 · 179. since r − b ≥ 0. −6. 2312 = q3 d + r.} is the family of integers of the form 3k + 1. −2. Since either k or 3k − 1 is even. A = {. If p > 3 is a prime. 19 are prime. . 6. From this it also follows that q1 = q2 . that is b|(r2 − r1 ). 6k ± 2 or 6k + 3.Division Algorithm 19 2. for some integers q1 . 9. We conclude that d − r = 179 − 164 = 15. 3. 5. 1. 43 Example Show that n2 + 23 is divisible by 24 for inﬁnitely many n. every integer lies in one of the families 3k. 13. 15. 12. . k ∈ Z. Since d > 1. integers come in one of six ﬂavours: 6k. q2 . k ∈ Z. . k ∈ Z. 17. . 3k + 1 or 3k + 2 where k ∈ Z. . then p is of the form p = 6k ± 1 (the other choices are either divisible by 2 or 3). then 24|(p2 − 1). is the same as the family 3k − 1. assume that bq1 + r1 = a = bq2 + r2 . Consider the set S = {a − bk : k ∈ Z and a ≥ bk}. By construction. 2. 0 ≤ r1 < b. q3 . r such that a = bq+r. 12k(3k − 1) is divisible by 24. 2. . Then r > r − b = a − bq − b = a − (q + 1)b ≥ 0. It is important to realise that given an integer n > 0. . 5. whence r2 = r1 . 3. . 8. 10. where a/b denotes the integral part of a/b. For example. the Division Algorithm makes a partition of all the integers according to their remainder upon division by n. . 18. 20 are composite. Thus Z = A ∪ B ∪C where is the family of integers of the form 3k. Then r2 − r1 = b(q1 − q2 ). Let us prove that r < b. By the Well-Ordering Principle. . . 14. 0. then there are unique integers q. 2. Now. Thus we must have 0 ≤ r < b. But |r2 − r1 | < b. But then a − (q + 1)b ∈ S and a − (q + 1)b < r which contradicts the fact that r is the smallest member of S . −9. k = 0. . say r. Then S is a collection of nonnegative integers and S = ∅ as a − b · 0 ∈ S . −4. 1. 7. The number 1 is neither a prime nor a composite. u 41 Theorem (Division Algorithm) If a. . . 6k ± 1.2 Division Algorithm Proof: We use the Well-Ordering Principle. . Find the value of d − r. −1. 42 Example (AHSME 1976) Let r be the remainder when 1059. 0 ≤ r < b. Solution: By the Division Algorithm.} B = {. If we take n = 24k ± 1. 4. . we conclude that d = 179. − 7. . d|1253 = 7 · 179 and 7|895 = 5 · 179. From this. 358 = 1417 − 1059 = d(q2 − q1 ). 6. If the integer n > 1 is not prime. − 8. It is quite plain that q = a/b .

47 Example Prove that no integer in the sequence 11. If not. is the square of an integer. Problem 2. 11111. Problem 2. Solution: It is clear that a3 b − ab3 = ab(a − b)(a + b) is always even. x |(y + 1) and (x + 1) |(y + 1). one can always choose two so that a3 b − ab3 is divisible by 10. then 3|a and 3|b Solution: Assume a = 3k ± 1 or b = 3m ± 1. Hint: Try x = 36k + 14. All the numbers in this sequence are of the form 4k − 1. and so there must be two whose sum or whose difference is divisible by 5. any integer comes in one of two ﬂavours: 2a or 2a + 1.7 Prove that there are inﬁnitely many integers n such that 4n2 + 1 is divisible by both 13 and 5. then we are done.9 Prove that 3 never divides n2 + 1.e.8 Prove that any integer n > 11 is the sum of two b b positive composite numbers.2. and ε = ±1 such that Problem 2.2. i. and so they cannot be the square of any integer. then there are unique integers q and r such that a = qb + r. y = (12k + 5)(18k + 7). Squaring. 2 2 Problem 2.2. (2a + 1)2 = 4(a2 + a) + 1 and so the assertion follows. 111. Algorithm: if a and b = 0 are integers.1 Prove the following extension of the Division composite.2. Problem 2.2. no matter which integers are substituted. then there are unique integers q and r. . y such that x(x + 1)|y(y + 1) but Problem 2.3 Show that the product of two numbers of the form 4k + 3 is of the form 4k + 1.10 Show the existence of inﬁnitely many natural remainder 1 upon division by 8..2. Hint: Think of n − 6 if n is even and n − 9 if n is odd. 1111.2. 2n + 1 is prime.6 Let n > 1 be a positive integer. we are choosing three integers that lie in the residue classes 5k ± 1 or 5k ± 2. Two of them must lie in one of these two groups.2.4 Prove that the square of any odd integer leaves Problem 2. numbers x. b2 = 3y + 1.20 46 Example Prove that the square of any integer is of the form 4k or 4k + 1.2 Show that if a and b are positive integers. Prove that if one of the numbers 2n − 1. Problem 2. Problem 2. 3 |(a2 + b2). (2a)2 = 4a2 . Practice Problem 2. The assertion follows. then the other is x |y and (x + 1) |y. 0 ≤ r < |b|. But then a2 + b2 = 3t + 1 or a2 + b2 = 3s + 2.5 Demonstrate that there are no three consecutive odd integers such that each is the sum of two squares and also greater than zero.2.2. Solution: The square of any integer is of the form 4k or 4k + 1. . a = qb + ε r. . 48 Example Show that from any three integers. Then a2 = 3x + 1. . 49 Example Prove that if 3|(a2 + b2 ). − < r ≤ . If one of the three integers is of the form 5k. Chapter 2 Solution: By the Division Algorithm.

Each factor is greater than 1 for n > 1. each factor is greater than 1. Each term in the denominator is < p. k k=1 and every term is divisible by n2 . It is easy to see that if n ≥ 3.3 Some Algebraic Identities In this section we present some examples whose solutions depend on the use of some elementary algebraic identities. p−1 2 p−2 (p − 1)/2 (p + 1)/2 After summing consecutive pairs. Thus the only such prime is 7. By the Binomial Theorem. If the expression were prime. Clearly one must take n odd. Since p is a prime. Solution: The expression is only prime for n = 1. n2 divides the quantity (n + 1)n − 1. n Ç å n k n (n + 1) − 1 = n.e. 53 Example Prove that for all n ∈ N .Some Algebraic Identities 21 2. and so n4 + 4 cannot be a prime. 50 Example Find all the primes of the form n3 − 1. so this number cannot be a prime. the p on the numerator will not be thus cancelled out. 52 Example Find all integers n ≥ 1 for which n4 + 4n is a prime. Assume n > 1. we must have n − 1 = 1. Solution: If n = 1 this is quite evident. Solution: n3 − 1 = (n − 1)(n2 + n + 1). 51 Example Prove that n4 + 4 is a prime only when n = 1 for n ∈ N. n = 2. 54 Example Prove that if p is an odd prime and if a = 1 + 1/2 + · · ·+ 1/(p − 1). the numerator of the resulting fractions is p. For n ≥ 3 odd all the numbers below are integers: n4 + 22n = = = n4 + 2n22n + 22n − 2n22n Ä ä2 (n2 + 2n )2 − n2(n+1)/2 (n2 + 2n + n2(n+1)/2)(n2 + 2n − n2(n+1)/2). Solution: Observe that n4 + 4 = = = = n4 + 4n2 + 4 − 4n2 (n2 + 2)2 − (2n)2 (n2 + 2 − 2n)(n2 + 2 + 2n) ((n − 1)2 + 1)((n + 1)2 + 1). . since n2 + n + 1 is always greater than 1. b then p divides a. for integer n > 1. i. Solution: Arrange the sum as 1+ 1 1 1 1 1 + + + ··· + + .

2903n − 464n is divisible by 2903 − 464 = 9 · 271 and 261n − 803n is divisible by −542 = (−2)271. xy = 0. ﬁnd it. By symmetry. contrary to the assertion that xn + yn = zn . the result follows at once from the identity n−1 an − 1 ak = a = 1. 57 Example ((UM)2C4 1987) Given that 1002004008016032 has a prime factor p > 250000. a−b where k < 250000. 2903n − 803n is divisible by 2903 − 803 = 2100 = 7 · 300 =. we may suppose that x < y. Therefore p = 250501. Since 7 and 271 have no prime factors in common. n are natural numbers n ≥ z. z then x < z and y < z. Solution: If a = 103 . This establishes the assertion. In that case. 1856) If x. 58 Example (Grünert. 2903n − 803n − 464n + 261n is divisible by 1897 for all natural numbers n. we can conclude that the expression is divisible by 7 · 271 = 1897. a6 − b6 . b = 2 then 1002004008016032 = a5 + a4b + a3b2 + a2 b3 + ab4 + b5 = This last expression factorises as a6 − b6 a−b = = = (a + b)(a2 + ab + b2)(a2 − ab + b2) 1002 · 1002004 · 998004 4 · 4 · 1002 · 250501 · k. the result being otherwise trivial.22 55 Example Prove that Chapter 2 xn − yn = (x − y)(xn−1 + xn−2y + xn−3 y2 + · · · + xyn−2 + yn−1 ) Thus x − y always divides xn − yn . Thus the expression is also divisible by 271. Solution: By the preceding problem. a−1 k=0 upon letting a = x/y and multiplying through by y . . So assume that xn + yn = zn and n ≥ z. Then zn − yn = (z − y)(zn−1 + yzn−2 + · · · + yn−1 ) ≥ 1 · nxn−1 > xn . Solution: We may assume that x = y. n Without calculation we see that 8767 ˝ ˝ 56 Example (Eotvos 1899) Show that 2345 − 81012345 is divisible by 666. then the relation xn + yn = zn does not hold. y. Also. Thus the expression 2903n − 803n − 464n + 261n is divisible by 7. z. y. Solution: It is clear that if the relation xn + yn = zn holds for natural numbers x. and 261n − 464n is divisible by 261 − 464 = −203 = 7 · (−29).

1 91 ones 2. . 2. is the square of an integer. k = 2. . Solution: It sufﬁces to take x = 2n − 1. prove that (a + 1/2)n + (b + 1/2)n is an integer only for ﬁnitely many positive integers n. n obviously share their prime factors and m − 1 = 2(2k−1 − 1) shares its prime factors with n − 1 = 2k+1 (2k−1 − 1). 62 Example Determine inﬁnitely many pairs of integers (m.3.11 and observing that (−y)n = −yn for n odd. 61 Example (S250) Show that for any natural number n. 1. .1 Show that the integer 1. Problem 2. 3. since each of 11993 + 10001993. . Thus if n is odd. there is another natural number x such that each term of the sequence x + 1. n n+1 bn+1 − an+1 > (n + 1)a. n = (2k − 1)2 . x + y divides xn + yn .3. . . . Show that Å 1 1+ n ãn+1 Å > 1+ 1 n+1 ãn+2 n = 1. then a4 + 4b4 is composite. Problem 2. .4 Demonstrate that for any natural number n. Problem 2.7 Prove that 100|1110 − 1.3. Problem 2.. 2. Solution: Follows at once from the previous problem.6 If a. xx + 1. . 2. 23 xn + yn = (x + y)(xn−1 − xn−2 y + xn−3y2 − + − · · · + −xyn−2 + yn−1). .. Prove that bn ((n + 1)a − nb) < an+1 . b−a 4. Solution: This is evident by substituting −y for y in example 1. 21993 + 9991993.3 Show that if |ab| = 1. .Practice 59 Example Prove that for n odd. the number 1······1−2··· 2 2n 1′ s n 2′ s 3. 5001993 + 5011993 is divisible by 1001. . .. . is divisible by n.3.. Solution: Take m = 2k − 1.3. . b are positive integers. . . . is composite.2 Prove that 199 + 299 + 399 + 499 is divisible by 5.3. . Show that Problem 2. Problem 2. 60 Example Show that 1001 divides 11993 + 21993 + 31993 + · · · + 10001993. Prove that for n = 1. . Practice Problem 2. n − 1) x share their prime factors. . xx + 1. .3. Then m.5 Let 0 ≤ a < b. n) such that M and n share their prime factors and (m − 1. Å Å ã ãn+1 1 n 1 1+ < 1+ n = 1.

.3. written as usual in base-ten are such that equals their digits are alternating 1’s and 0’s.17 Find all the primes of the form n + 1.3. .3. n 4′ s n−1 8′ s Chapter 2 Problem 2.23 Prove that the product of four consecutive natural numbers is never a perfect square. Problem 2.3. b 2 3 4 1318 1319 prove that 1979|a. Simplify the expression » » √ √ a + 2 a − 1 + a − 2 a − 1. 22 + 1 divides 22 2n +1 n 2 n − 2. c. b. Prove that 1 A1/n − B1/n < n for all n = 2.3. d must add up to 0. 2.9 Demonstrate that every number in the sequence 49. Problem 2. Prove that a pair of the a. 4489.22 (ITT. then k a is even and n is a power of 2. Show that if n is a called Fermat primes. positive integer.3. Use this to prove that for all positive integers n. b.15 (Putnam.21 Let a. 444889. (Hint: Consider 22225555 + 45555 + 55552222 − 42222 + 42222 − 45555. .3. 1 1 1 1 1 − 1 − + − + ···+ 2 3 4 2n − 1 2n Problem 2.3.26 (IMO. Problem 2. c. b. is prime. 1994) Let a. Problem 2.13 Prove that if an + 1. . .10 (Polish Mathematical Olympiad) Prove that if n is an even natural number.3. 1 < a ∈ N. Problem 2. then a = 2 and n is a prime.14 Prove that if an − 1.3.24 Problem 2. .3. 44448889. Prove that a = b = c = d.3. Problem 2. .16 Find the least value achieved by 36k − 5k . then nk can be represented as the sum of n successive odd numbers.. Problem 2. d be real numbers such that a2 + b2 + c2 + d 2 = ab + bc + cd + da.) Hint: What is (n2 + n − 1)2? Problem 2. d be complex numbers satisfying a + b + c + d = a3 + b3 + c3 + d 3 = 0. Problem 2. Primes of the form 2n − 1 are called Problem 2. b. is prime. Primes of the form 22 + 1 are Problem 2. n+1 n+2 2n Problem 2.3. then the number 13n + 6 is divisible by 7. .19 Let a > 1 be a real number.12 Prove that the number 22225555 + 55552222 is divisible by 7. 4. 3. Problem 2. . b are natural numbers such that 1 1 1 1 1 a = 1 − + − + ···− + .3.11 Find. 1989) How many primes amongst the positive integers.3.3. 3 1 1 1 + + ··· + . 1979) If a.3.18 Find a closed formula for the product P = (1 + 2)(1 + 22)(1 + 22 ) · · · (1 + 22 ). Problem 2. 4 · · · · · · 4 8 · · · 8 9. Show that 3(ab + bc + ca) ≤ (a + b + c)2 ≤ 4(ab + bc + ca).. c be the lengths of the sides of a triangle.3. k = 1. beginning and ending in 1? Problem 2. with proof. A > B. the unique square which is the product of four consecutive odd numbers. Suppose that A and B have more than half of their digits on the sinistral side in common. 1 < a ∈ N. is the square of an integer.24 Let k ≥ 2 be an integer. . .25 (Catalan) Prove that Mersenne primes. c. Problem 2.3.20 Let a.8 Let A and B be two natural numbers with the same number of digits.

25 Problem 2.30 (Polish Mathematical Olympiad) Prove that amongst ten successive natural numbers. Problem 2. Prove that none of the digits 2.28 Demonstrate that there are inﬁnitely many Problem 2. 5. 2 2 write 4n + 1 as the sum of two squares. Conversely.3.Practice Problem 2. .3. each raised to the fourth power. Problem 2.27 (Polish Mathematical Olympiad) A triangular number is one of the form 1 + 2 + .31 Show that if k is odd. there are always at least one and at most four numbers that are not divisible by any of the numbers 2. + n. 4. 7. . a2 + a b2 + b n= + .3. equals the ﬁfth raised to the fourth power? .29 (Putnam. 1 + 2 + ···+ n divides 1k + 2k + · · · + nk . 1975) Supposing that an integer n is the sum of two triangular numbers. 9 can be the last digit of a triangular number.3. show that if 4n + 1 = x2 + y2 . Problem 2. n ∈ N.3. square triangular numbers. then n is the sum of two triangular numbers.3. 7. 3.32 Are there ﬁve consecutive positive integers such that the sum of the ﬁrst four. 4n + 1 = x2 + y2 where x and y are expressed in terms of a and b.

a − c ≡ b − d mod m 3. and (5) follows from (4). Proof: As a ≡ b mod m and c ≡ d mod m. Solution: Observe that 32n+1 ≡ 3 · 9n ≡ 3 · 2n mod 7 and 2n+2 ≡ 4 · 2n mod 7. −8 ≡ −1 ≡ 6 ≡ 13 mod 7.Chapter 3 Congruences. ac ≡ bd mod m 4. Solution: 62 ≡ −1 mod 37. For example. u Congruences mod 9 can sometimes be used to check multiplications. Since n|(a − b) implies that ∃k ∈ Z such that nk = a − b. k ∈ with a ≡ b mod m and c ≡ d mod m. 63 Lemma Let a. Zn 3. we can ﬁnd k1 . which is patently false. ak ≡ bk mod m 5. m ∈ Z. k2 ∈ Z with a = b + k1 m and c = d + k2 m. we deduce that a ≡ b mod n if and only if there is an integer k such that a = b + nk. Property (4) follows by successive application of (3). mod 9. Thus a ± c = b ± d + m(k1 ± k2 ) and ac = bd + m(k2 b + k1 d). Hence 32n+1 + 2n+2 ≡ 7 · 2n ≡ 0 for all natural numbers n. (2) and (3). It also indicates that a and b leave the same remainder upon division by n. 26 mod 7. 64 Example Find the remainder when 61987 is divided by 37. For example 875961 · 2753 = 2410520633. and it means that n|(a − b). d. If f is a polynomial with integral coefﬁcients then f (a) ≡ f (b) mod m.1 Congruences The notation a ≡ b mod n is due to Gauß. Thus 61987 ≡ 6 · 61986 ≡ 6(62 )993 ≡ 6(−1)993 ≡ −6 ≡ 31 mod 37. 65 Example Prove that 7 divides 32n+1 + 2n+2 for all natural numbers n. c. For if this were true then (8 + 7 + 5 + 9 + 6 + 1)(2 + 7 + 5 + 3) ≡ 2 + 4 + 1 + 0 + 5 + 2 + 0 + 6 + 3 + 3 But this says that 0 · 8 ≡ 8 mod 9. . These equalities give (1). a + c ≡ b + d mod m 2. Then 1. b. We start by mentioning some simple properties of congruences.

then x2 ≡ 2 mod 5. Now 22225555 + 55552222 ≡ 35555 + 42222 ≡ (35 )1111 + (42 )1111 ≡ 51111 − 51111 ≡ 0 mod 7. 70 Example Find the units digit of 77 . that March 1st is the 50th or 51st day of the year. 7 7 mod 10. Now. Hence 27 · 5 ≡ −1 mod 641 and 54 ≡ −24 mod 641. thus each year. 7 Solution: We must ﬁnd 77 mod 10. which means that there is an integer t such that 77 = 3 + 4t. Also. 32 ≡ 9. 1. . each remainder class modulo 7 is represented in the third column. Squaring the nonnegative integers up to 6. the ﬁrst day of a month in each year falls in one of the following days: Month Day of the year mod 7 January 1 1 February 32 4 March 60 or 61 4 or 5 April 91 or 92 0 or 1 May 121 or122 2 or 3 June 152 or 153 5 or 6 July 182 or183 0 or 1 August 213 or 214 3 or 4 September 244 or 245 6 or 0 October 274 or 275 1 or 2 November 305 or 306 4 or 5 December 335 or 336 6 or 0 (The above table means that. Upon assembling all this. 12. 5555 ≡ 4 mod 7 and 35 ≡ 5 mod 7. 4. Solution: If x2 = 2 − 5y2. 3.Congruences 66 Example Prove the following result of Euler: 641|(232 + 1). has at least one Sunday the 1st. has at least one Friday 13-th. 68 Example Prove that there are no integers with x2 − 5y2 = 2. 22 ≡ 4. 9. 52 ≡ 12. Solution: 2222 ≡ 3 mod 7. 42 ≡ 3. 72 ≡ −1 mod 10. 67 Example Find the perfect squares mod 13. Therefore the perfect squares mod 13 are 0. 71 Example Prove that every year. depending on whether the year is a leap year or not. whether leap or not. Solution: First observe that we only have to square all the numbers up to 6. But 2 is not a perfect square mod 5. 12 ≡ 1. etc. Now. we obtain 02 ≡ 0. Now. 72 ≡ 1 mod 4 and so 77 ≡ (72 )3 · 7 ≡ 3 mod 4. 27 · 5 ≡ −1 mod 641 yields 54 · 228 = (5 · 27 )4 ≡ (−1)4 ≡ 1 mod 641. This last congruence and 54 ≡ −24 mod 641 yield −24 · 228 ≡ 1 mod 641. and 10. Solution: It is enough to prove that each year has a Sunday the 1st. 62 ≡ 10 mod 13. 27 Solution: Observe that 641 = 27 · 5 + 1 = 24 + 54 . including any leap year. which means that 641|(232 + 1).) Now. because r2 ≡ (13 − r)2 mod 13. and so 73 ≡ 72 · 7 ≡ −7 ≡ 3 mod 10 and 74 ≡ (72 )2 ≡ 1 mod 10. 77 ≡ 74t+3 ≡ (74 )t · 73 ≡ 1t · 3 ≡ 3 Thus the last digit is 3. 69 Example Prove that 7|(22225555 + 55552222).

. of the Diophantine equation n4 + n4 + · · · + n4 = 1599. 2. . 26 ≡ 1 mod 7 and so 23k ≡ 1 mod 3 for all positive integers k. . As a ≡ 3 mod 10. . . consists of those positive multiples of 3 that are one less than a perfect square. 1. k = 1. never leaves remainder 1 when divided by 7.. . The sequence 3k − 1. Since 3 is prime. 15. . 1994) The increasing sequence 3. this requires n = 3k + 1 or n = 3k − 1. 73 Example Are there positive integers x.. n2 . Finally. Solution: 21 ≡ 2. n14 ) if any. and this cycle of three repeats. k = 1. 48. . Now. 2. 76 Example (USAMO. . . 1 2 14 Solution: There are no such solutions. Thus 2y + 15 ≡ 2. . every power of 2 is congruent to 1. . 1979) Determine all nonnegative integral solutions (n1 . Then [(1020000)/10100 +3] = [(a−3)200/a] = [ 200 Since k=0 (−1)k Ç å 200 = 0. 2. 2. . .. 15. 3. But 1599 ≡ 15 mod 16. We must ﬁnd the 997th term of the sequence 3k + 1. This is an impossibility. or 5 mod 7. 77 Example (Putnam. or 6 upon division by 7. .. 74 Example Prove that 2k − 5. 15. The sequence 3k + 1. . and 6. k = 0. k . The perfect cubes mod 7 are 0. 1. 4. What is the remainder when the 1994-th term of the sequence is divided by 1000? Solution: We want 3|n2 − 1 = (n − 1)(n + 1). . k 199 1 a 200 Ç å 200 200−k a (−3)k ] = k 199 k=0 Ç å 200 199−k a (−3)k . k = 1. 24 ≡ 2. 48. . 24. 23 ≡ 1 mod 7. 22 ≡ 4. .. 48. . 24. 2. . or 4 mod 7. . 23 ≡ 1. 75 Example (AIME. . y such that x3 = 2y + 15? Solution: No. 2. k = 1. This means that n4 + · · · + n4 1 14 can be at most 14 mod 16. 22 ≡ 4. . 25 ≡ 4. 24. the term sought is (3(997) + 1)2 − 1 ≡ (3(−3) + 1)2 − 1 ≡ 82 − 1 ≡ 63 mod 1000. 1986) What is the units digit of 1020000 ? 10100 + 3 Solution: Set a−3 = 10100. All perfect fourth powers mod 16 are ≡ 0 or 1 mod 16. apart from permutations. (3)199 k 199 k=0 199 (−1)k k=0 Ç å 200 199−k a (−3)k ≡ 3199 k Ç k=0 å 200 = −3199 .28 72 Example Find inﬁnitely many integers n such that 2n + 27 is divisible by 7. . . This produces the inﬁnitely many values sought. Thus 2k − 5 can leave only remainders 3. Chapter 3 Solution: Observe that 21 ≡ 2. k (−1) k k=0 Ç å 200 ≡ −3199 ≡ 3 mod 10. The remainder sought is 63. produces the terms n2 − 1 = (3k + 1)2 − 1 which are the terms at even places of the sequence of 3. . Hence 23k + 27 ≡ 1 + 27 ≡ 0 mod 7 for all positive integers k. 3. produces the terms n2 − 1 = (3k − 1)2 − 1 which are the terms at odd places of the sequence 3. .

. depending on whether they are all even. Prove that a1 = a2 = . . n ≥ k ≥ 2. since (n − 2)! is divisible by k!. a2n+1 be a set of integers such that if any one of them is removed. there is an integer k such that n |(k + a). = a2n+1. 4k + 3 or 4k + 1 respectively. n |(k + b). 81 Example Let Prove that for all n ∈ N. b. a2 . . å √ √ 6n + 2 k 3 = (1 + 3)6n+2 + (1 − 3)6n+2 . k ∈ N. 2S := 2 3n+1 Ç k=0 å 6n + 2 k 3 ≡ 0. The assertion follows. Continuing in this manner we arrive at the conclusion that the ak are all congruent mod 2k for every k. where M is an integer. Since n > 3. no matter which of the ak be taken. Thus they are all congruent mod 4. 80 Example Prove that n−1 (kn)! ≡ 0 if n. n |(k + c). . when n is of the form 2k. n > 3. mod n. say k for which −k ≡ a. . n > 3. if n is odd. The property stated in the problem is now shared by ak /2 or (ak − 1)/2. 82 Example Prove that 6n+2 Ç k=0 n(n − 1)(n − 2)!(1 − 1/2! + · · · + (−1)n−1 /(n − 1)! + (−1)n/n!) Ä ä (n − 1) m + (−1)n−1n/(n − 1) + (−1)n/(n − 1) (n − 1) (m + (−1)n) . with a = 2 + 3. we have more than three distinct residue classes. n ∈ N. 2k 3n + 1 2 Ç3n + 1å r=0 1 3n+1 (a + b3n+1) 2 = 2r 23n+1−2r 3r . Solution: We have n!! = n! (1/2! − 1/3! + · · ·+ (−1)n /n!). c ∈ Z. mod r=0 (n + r) Solution: (kn)! = M(n − 1)!n(n + 1) · · ·(2n − 1) for some integer M ≥ 1. −k ≡ b. or all odd. b. 79 Example (Putnam. c belong to at most three different residue classes mod n. all the ak must have the same parity. . Thus there must be a residue class. 1973) Let a1 . and this may only happen if they are all equal. 23n+1. b = 2 − 3. Solution: As the sum of the 2n integers remaining is always even.Congruences 78 Example Prove that for any a. k ≤ n − 2. . 29 Solution: The integers a. −23n+1 2k mod 23n+2 √ √ Also. n!! ≡ n! n! − n!! = = = mod (n − 1). This solves the problem. −k ≡ c. ≡ 3(3n+1)/2 mod 4 ≡ (−1)(n−1)/2 mod 4. Solution: Using the Binomial Theorem. the remaining ones can be divided into two sets of n integers with equal sums.

2k + 1 Problem 3.) Problem 3.8 (AHSME 1992) What is the size of the largest subset S of {1.1.10 Prove that if 7|a2 + b2 then 7|a and 7|b. 1986) What is the smallest integer n > 1. Problem 3.1.. of S has a sum divisible by 7? Problem 3. . 2.7 Find the last digit of 3100 .1.1. a2 − b2. Problem 3. .1.1.5 Describe all integers n such that 10|n10 + 1.1. b.1.19 (USAMO.13 Prove that Problem 3. The root mean square of n numbers a1 .4 Prove that if 9|(a3 + b3 + c3 ). . Problem 3. for all n ≥ p. perfect square cannot be equal to 1991. a3 − b3. Problem 3.1.1. then 3|abc.15 Prove that if p is a prime.1.18 Find the last two digits of 3100 . 50} such that no pair of distinct elements Problem 3. Problem 3.9 Prove that there are no integer solutions to the equation x2 − 7y = 3.30 As 2S = 23n+1 (a3n+1 + b3n+1). S ≡ 23n+2 2n + 1 mod 23n+4 . Problem 3. Problem 3.1.11 Prove that there are no integers with 800000007 = x2 + y2 + z2 .1.6 Prove that if a − b.1 Find the number of all n. Problem 3. Ç å 3n + 1 2r+1 3n−2r 2 3 2r + 1 ≡ ≡ So for even n.1.1.17 Prove that every non-multiple of 3 is a perfect power of 2 mod 3n . then a and b must also be integers. Practice Problem 3. .1. for k=0 integers a.. Ç å n n − [ ] is dip p n n Problem 3. . c.3 (P OLISH M ATHEMATICAL O LYMPIAD ) What digits should be put instead of x and y in 30x0y03 in order to give a number divisible by 13? 7|42 + 22 + 1 for all natural numbers n.an is deﬁned to be ã Å 2 2 2 1/2 a1 + a2 + ··· + an n .12 Prove that the sum of the decimal digits of a n2 + 15n + 122 is divisible by 6. . a4 − b4 . 1 3n+1 (a + b3n+1) 2 = 2r≤3n Chapter 3 mod 23n+3. Problem 3. (Hint: n2 + 15n + 122 ≡ n2 + 3n + 2 = (n + 1)(n + 2) mod 6. 2(6n + 1)33n mod 8 4n + 2 mod 8. Problem 3. 1 ≤ n ≤ 25 such that Problem 3.1.a2 . Determine the remainder when a83 is divided by 49.16 How many perfect squares are there mod 2n ? Problem 3. are all integers. visible by p. .1. we have. . for odd n. for which the root-mean-square of the ﬁrst n positive integers is an integer? Note.14 Prove that 5 never divides Ç å n 2n + 1 23k .2 (AIME 1983) Let an = 6n + 8n . S ≡ (−1)(n−1)/2 23n+1 If n is even. .1..

Therefore n ≡ (−1)k ak + (−1)k−1 ak−1 + · · · − a1 + a0 mod 11. 85 Example (IMO. Thus the sum of the digits of B is at most 12. . so it follows that B ≤ 45. p. we have 10 j ≡ 1 mod 9. Amongst all natural numbers ≤ 159984 the one with maximal digit sum is 99999. c. whence A ≤ 159984. . 31 Problem 3. namely 12. As 10 ≡ −1 mod 11. This means that 44444444 has at most 17776 digits. a2 . What is the largest power of 3 that divides this number? Solution: By the casting-out-nines rule. whence the theorem. a > 1 and all prime numbers p. 1992) The two-digit integers from 19 to 92 are written consecutively in order to form the integer 192021222324 · · ·89909192. 1. 4444 log10 4444 < 4444 log10 104 = 17776. z are positive integers with xn + yn = zn for an odd integer n ≥ 3.1. n 2 (−1)i ai is divisible i=0 by x2 ± x + 1. 7 ≡ 44444444 ≡ A ≡ B ≡ C mod 9. 83 Theorem (Casting-out 9’s) A natural number n is divisible by 9 if and only if the sum of it digits is divisible by 9. c. Proof: Let n = ak 10k + ak−1 10k−1 + · · · + a1 10 + a0 be the base-10 expansion of n. k be arbitrary integers. it follows that C = 7. i = 0. Find the sum of the digits of B. . n is divisible by 11 if and only if the alternating sum of its digits is divisible by 11. so the sum of the digits of 44444444 is at most 9 · 17776 = 159984. this number is divisible by 9 if and only if 19 + 20 + 21 + · · ·+ 92 = 372 · 3 is. and hence 44443 ≡ 73 ≡ 1 mod 9. we have an ample number of rules of divisibility.Divisibility Tests Problem 3.22 (IMO. Let C be the sum of the digits of B. 912282219 ≡ 9−1+2−2+8−2+2−1+9 ≡ 7 mod 11 and so 912282219 is not divisible by 11. For example.23 For each integer n > 1. Therefore. and so 8924310064539 is divisible by 11.24 Let x and ai . 1975) When 44444444 is written in decimal notation. the sum of its digits is A. prove that z cannot be a prime-power.20 Find all integers a.21 Show that the number 16 is a perfect 8-th is divisible by x2 ± x + 1 if and only if power mod p for any prime p. .1. A criterion for divisibility by 11 can be established similarly. The most famous one is perhaps the following. a3 . It follows that n = ak 10k + · · · + a1 10 + a0 ≡ ak + · · · + a1 + a0 . b. For let n = ak 10k + ak−1 10k−1 + · · · + a1 10 + a0. . . b. Thus 44444444 = 44443(1481) · 4444 ≡ 1 · 7 ≡ 7 mod 9. But since C ≡ 7 mod 9. the number is divisible by 3 but not by 9. 1975) Let a1 . By the casting-out 9’s rule. whereas 8924310064539 ≡ 8 − 9 + 2 − 4 + 3 − 1 + 0 − 0 + 6 − 4 + 4 − 3 + 9 ≡ 0 mod 11. As 10 ≡ 1 mod 9. Let B be the sum of the digits of A. Prove that for every s ≥ 1 there are inﬁnitely many am that can be written in the form am = xas + yat with positive integers x and y and t > s. r which satisfy the equation pa = qb + r c (a.1.25 ((UM)2C9 1992) If x. Now. Prove that k ai (x2 + 1)3i i=0 k Problem 3.) Solution: We have 4444 ≡ 7 mod 9. (A and B are written in decimal notation. 39 has the largest digital sum.2 Divisibility Tests Working base-ten. q. . r need not necessarily be different). q. 3. that is. Of all the natural numbers ≤ 45. Problem 3. y.1. Problem 3. Problem 3. . be an increasing sequence of positive integers. prove that n − n + n − 1 is divisible by (n − 1)2. we have 10 j ≡ (−1) j mod 11.1.1. u 84 Example (AHSME.

an are integers with an = 0. and divide the remaining coconuts into ﬁve equal piles. How many cute sixdigit integers are there? Answer: 2.2y. 2 divides 32. one after the other. the new 1953-digit number is also divisible by 27. For example. sailors do likewise.2 How many ways are there to roll two distinguishable dice to yield a sum that is divisible by three? Answer: 12.2. b|an .2. one of them wakes up and decides to take his share. .8 1953 digits are written in a circular order.3 Prove that a number is divisible by 2k . where a and b are relatively prime integers.2. The other four length 60. a1 . What . Problem 3. prove that f (x) = 0 has no rational roots. . Practice Problem 3.2.10 Prove that In the morning the ﬁve sailors throw a coconut to the monkey 2 2 f2n+1 ≡ fn+1 mod fn .32 86 Example (Putnam. Suppose that x0 is a rational number such that p(x0 ) = 0. . amongst themselves in the morning. is the smallest amount of coconuts that could have been in the original pile? Answer: 15621 Problem 3. 321 is a cute three-digit number because 1 divides 3. During the night. . whence a and b are both odd. Problem 3. If a0 . and let p(x) = a0 + a1 x + · · · + anxn . 111 111 111 is divisible by 9. Problem 3. .2.2. then if we read these digits in the same How much did each chicken cost? direction beginning with any other digit. mod 2. Prove that if the 1953-digit numbers obtained when we read Problem 3. Then 0 = bn f (a/b) = a0 bn + a1 bn−1 a + · · · + an−1 ban−1 + an an . Test whether 90908766123456789999872 is divisible by 8. By the relative primality of a and b it follows that a|a0 . . 1 ≤ k ≤ n. an and f (1) are all odd.2.2. Problem 3. where x and y are unreadable digits. each throwing a coconut to the monkey and taking one ﬁfth of the remaining pile. It reads 88 chickens these digits in dextrogyral sense beginning with one of the digat the total of $x4. 1952) Let Chapter 3 n f (x) = k=0 ak xn−k be a polynomial of degree n with integral coefﬁcients. For example.1 (AHSME 1991) An n-digit integer is cute if its n digits are an arrangement of the set {1. Answer: 73 cents. k ∈ N if and only if the number formed by its last k digits is divisible by 2k .9 (Lagrange) Prove that Problem 3. then ak x0 + ak+1 x2 + · · · + anxn−k+1 0 is an integer. its is divisible by 27. n} and its ﬁrst k digits form an integer that is divisible by k for all k. Show that if 1 ≤ k ≤ n. . Problem 3.2.2.5 Five sailors plan to divide a pile of coconuts fn+60 ≡ fn mod 10. After throwing a coconut to a monkey to make the division come out even. he Thus the last digit of a Fibonacci number recurs in cycles of takes one ﬁfth of the pile and goes back to sleep. Solution: Suppose that f (a/b) = 0. Problem 3. 2.7 ((UM)2C8 1991) Suppose that a0 . Hence a0 bn + aabn−1 a + · · · + an−1ban−1 + anan ≡ a0 + a1 + · · · + an = f (1) ≡ 1 but this contradicts that a/b is a root of f .6 Prove that a number which consists of 3n identical digits is divisible by 3n .4 An old receipt has faded. and 3 divides 321.

e. Table ?? contains all the possible additions. 0 satisﬁes 0 +3 a = a +3 0 = a for all a ∈ Z3 2. It is clear that given any ﬁnite set of integers. a2 . Notice that the set B = {−40. c ∈ Z3 we have a +3 (b +3 c) = (a +3 b) +3 c.1: Addition Table for Z3 Table 3. 1. 0) are in Z12 such that a +12 b = 0? .e. 3} does not. 1. +n >. b ∈ Z3 we consider a + b mod 3. As an example. . 4. The operation addition in Z3 is associative.2).3.1 Construct the addition tables for Z8 and Z9 .3 Complete Residues The following concept will play a central role in our study of integers. the set A = {0.2: Addition Table for Z6 Tied up with the concept of complete residues is that of Zn . 2. and consider the set Z3 = {0. Now.3. . −2. 35} forms a complete residue set mod 6. for all a. b) = (0. 7. 22. since any integer x is congruent to one and only one member of A . 87 Deﬁnition If a ≡ b mod n then b is called a residue of a modulo n. +6 > on Table (1. this set will form a complete set of residues modulo n if and only if the set has n members and every member of the set is incongruent modulo n. In Z3 we note that −0 = 0. as the group of residues under addition mod n. We will explore later the multiplicative structure of Zn . −1 = 2. Given a. 15. 1. but the set C = {−3. 3. −1. . 2. −2 = 1. 6. For example. let us take n = 3. i. 3. 2}. that is. as −3 ≡ 3 mod 6.2 How many distinct ordered pairs (a. an is called a complete residue system modulo n if for every integer b there is exactly one index j such that b ≡ a j mod n. 1 represent all those integers that leave remainder 1 upon division by 3. 5} forms a complete set of residues mod 6. and 2 all those integers that leave remainder 2 upon division by 3. an element such that a +3 b = b +3 a = 0. We then say that < Z3 . +3 > forms a group and we call it the group of residues under addition mod 3. Every element a ∈ Z3 has an additive inverse b. there is c ∈ {0. 1. We then deﬁne a +3 b to be equal to c.Complete Residues 33 3. +3 0 1 2 0 0 1 2 1 1 2 0 2 2 0 1 +6 0 1 2 3 4 5 0 0 1 2 3 4 5 1 1 2 3 4 5 0 2 2 3 4 5 0 1 3 3 4 5 0 1 2 4 4 5 0 1 2 3 5 5 0 1 2 3 4 Table 3. 2} such that a + b ≡ c mod 3. As a further example we present the addition table for < Z6 . Problem 3. b. i. We observe that Z3 together with the operation +3 as given in Table ?? satisﬁes the following properties: 1. Similarly we deﬁne < Zn . Practice Problem 3. We deﬁne addition in Z3 as follows.. The element 0 ∈ Z3 is an identity element for Z3 . A set a1 . We now let 0 represent all those integers that are divisible by 3. We denote the additive inverse of a by −a.

Chapter 4 Unique Factorisation 4. i. b is called the greatest common divisor of a and b.t|b. then [a. b = tn for integers m. If a. Therefore. Clearly one of ±a. We see then that if a|c and if b|c. we can ﬁnd integers q. Proof: Let A = {ax + by|ax + by > 0.1 GCD and LCM If a. A has a smallest element. there are integers x. 88 Theorem (Bachet-Bezout Theorem) The greatest common divisor of any two integers a. 0 ≤ r < d such that a = dq + r. say d. x. y with (a. there is an integer s with as = bc. b can be written as a linear combination of a and b. b). it must be divisible by the smallest common multiple of a and b. b are not zero. Then c = c · 1 = cax + cby = cax + asy.. This entails dq = a. b is called the least common multiple of a and b. We prove that d = (a. d|a. b]. b is divisible by (a. b) = 1. The theorem is thus proved. If (a. then a|c. by the Bachet-Bezout Theorem. This is denoted by (a. b) = ax + by. −6) = 2. Thus r = 0. From this it follows that a|c. namely d. then t|d. then r ∈ A is smaller than the smaller element of A . b). b) = 1. since c is a common multiple of both a and b. To do this we prove that d|a. b are relatively prime. Thus if a. not both zero. the smallest positive integer that is a multiple of a. d|b and that if t|a. Thus if d|a and d|b then d|(a. Assume that t|a. By the Division Algorithm. We can similarly prove that d|b. Since a|bc.e. that is. y ∈ Z}. b).e. If r > 0. Proof: As (a. a contradiction. We ﬁrst prove that d|a. r. then they have no factor greater than 1 in common. For example.t|b. (68. ±b is in A . b are integers. n. 1999) = 1. t|d. because any common divisor of a and b must divide the largest common divisor of a and b. as both a. b) or sometimes by gcd(a. gcd(1998. we say that a and b are relatively prime or coprime. Then r = a − dq = a(1 − qx0) − by0. there are x0 . Hence d = ax0 + bx0 = t(mx0 + ny0 ). b]|c. there are integers x. By the Well Ordering Principle.u 34 . the largest positive integer that divides both a. b ∈ Z. b). i. as wanted. 89 Lemma (Euclid’s Lemma) If a|bc and if (a. y with ax + by = 1. This is denoted by [a. y0 such that d = ax0 + by0 . The most important theorem related to gcd’s is probably the following. not both zero. u It is clear that any linear combination of a. Then a = tm. b) = 1.

(m2 . b and so it is divisible by d2 . On the other hand. b) for any non-zero integer c. (m2 . (a2 . (m. Thus cd2 is a common divisor of ca and cb and hence d1 |cd2 . bc) divides (ac. a2 − ab + b2) = 1 or 3. ) = 1. (m2 . (a.. b2 ) = (a. bc). Using the preceding problem again. Thus gcd(a. b) (a. b. b). hence it divides ac and bc. (a. Thus (m. b/d are integers. i. b)2 . In conclusion. y with d1 = acx + bcy = c(ax + by). n)n) = (m2 . This ﬁnishes the proof. But this is a linear combination of a/d. Therefore (a. Prove that (a + b. then cd2 |ca. But ax + by is a linear combination of a. bc) divides a and c(a. cd2 |cb. Proof: Let d1 = (ca. bc) = c(a. u It follows similarly that (ca. b/d) divides this linear combination.u 94 Example Let (a. As d2 |a and d2 |b. b/d) = 1. upon multiplying by (a. (a. n) = 1 implies (m2 . (a. . b)2 (a. we deduce Ç b2 a2 . n2 ) = 1. b)c)| gcd(a. b)2 . There is an integer s then such that sd2 = ax + by. n2 ) = (m2 . cb) = c(a. b)2 . Then (ca. cb) = |c|(a. b) and so it divides (a. there are integers x. 92 Lemma For nonzero integers a. b) ã = 1. (a. (a.u 91 Theorem Let c be a positive integer. b)c). (a. n) = 1. By the Bachet-Bezout Theorem we can ﬁnd integers x. (n. (a. By Theorem ??. i. As (m. We conclude that (a/d. n)m) = 1. b)c it divides bc. Å b a . n) = (n. n) = 1. But then (a/d)x + (b/d)y = 1. this last quantity equals (m2 . b)c). y such that ax + by = d. bc) = (a. b).e. We prove that d1 |cd2 and cd2 |d1 . (a.GCD and LCM 90 Theorem If (a. cb) and d2 = (a. b) = d. c. bc) divides a and bc.. b/d and so (a/d. b)c) divides a and bc and hence gcd(a. which is what we wanted. and hence By Theorem ??. b)c) divides (a. It follows that d1 = csd2 . Proof: Assume that (m. b). (m. then 35 a b ( . n)m)n).e. cd2 |d1 . Proof: Since (a. (a. b)2 å = 1. b) = 1. and a/d.u 93 Theorem (a2 . Using the preceding lemma twice. b2 ) = (a. divides 1. d d Proof: By the Bachet-Bezout Theorem. n).

104. when in fact we have d ≤ m. This means that dn |401 for all n. Could it be that large? The answer is yes. So. Hence d divides 3b(a + b) − 3ab = 3b2 . 96 Example (IMO. assume without loss of generality that x > 0.e.36 Solution: Let d = (a + b. m form an arithmetic progression of length m and common difference m!. . m. Prove that Chapter 4 (am − 1. 100 + (n + 1)2) = (100 + n2. . Solution: Let d = (2m − 1. 2mn = (ld − 1)m = j j=0 ud − 1. Thus 1 ≤ d < m and so. Now d divides (a + b)2 − a2 + ab − b2 = 3ab. Then t|(amx − 1) and t|(a−ny − 1). where t = k d . . But then d|(3a2 . an − 1 is divisible by ad − 1. They cannot both be positive because then d ≥ m + n. a2 − ab + b2). b2 ) = 3(a. Solution: Let d = ( fn . Thus d|( fn − fn−1 ) = fn−2 . n≥1 98 Example Prove that if m and n are natural numbers and m is odd. Thus the numerator and the denominator have no common factor greater than 1.. sd = m. 100 + n2 + 2n + 1) = (100 + n2. whence d = 1. Find max dn . 2n + 1). 109. l. 97 Example (AIME. an − 1). 1 ≤ l < s ≤ m. 2n + 1) = 1.td = n. d|(sm! + 1). As td + 1 = ud − 1. t|((amx − 1) − ad (a−ny − 1)) = ad − 1. Now. This means that any two terms of this progression are coprime. 116. Then am − 1 = (ad )s − 1 is divisible by ad − 1 and similarly. and 2m − 1 = kd. n be positive integers. 99 Example Prove that there are arbitrarily long arithmetic progressions in which the terms are pairwise relatively prime. But then d|(sm! + 1 − sm!) = 1.. y with mx + ny = d. 2. Then d|(s(lm! + 1) − l(sm! + 1)) = (s − l) < m. b)2 = 3. where we have used the fact that m is odd. d|3a2 . 95 Example Let a. d = 1. Thus dn |(2(100+n2)−n(2n+1)) = 200−n. n). . 3b2 ) = 3(a2 . Solution: The numbers km! + 1. . then (2m − 1. 2 = (kd + 1) = td + 1. Therefore. . for some natural n−1 Ç å n n− j n− j−1 mn n numbers k. a = 1. 100 Example Prove that any two consecutive Fibonacci numbers are relatively prime. 14n + 3 Solution: 2(21n + 4) − 3(14n + 3) = −1. 1959) Prove that the fraction 21n + 4 is irreducible for every natural number n. an − 1). Iterating on this process we deduce that d| f1 = 1 and so d = 1.n) − 1. y ≤ 0. Notice that x and y must have opposite signs (they cannot obviously be both negative. 2. for let n = 200. . then a200 = 100 + 2002 = 100(401) and a201 = 100 + 2012 = 40501 = 101(401). we must have d|2. are of the form an = 100 + n2. Hence. Thus d|(−1)n . Thus (ad − 1)|(am − 1. fn+1 ). an − 1) = a(m. n = 1. 1985) The numbers in the sequence 101. 2 Aliter: By Cassini’s Identity fn−1 fn+1 − fn = (−1)n . Similarly. 2n + 1). d| fn−1 . by the Bachet-Bezout Theorem there are integers x. The assertion is established. n≥1 Solution: We have the following: dn = (100 + n2. Solution: Set d = (m. . It follows that d must be an odd number. As fn+1 − fn = fn−1 and d divides the sinistral side of this equality. since then d would be negative. For each n let dn = (an . k = 1. Therefore dn |(2(200−n)+(2n+1)) = 401. d|m!. . In the same manner. d ≤ n). Suppose that d|(lm! + 1). i. an+1 ). Set t = (am − 1. . 2n + 1 = ld. . Thus max dn = 401.

Since a|m and a|n. The case = 1 is a triviality. c|d. a|m we have a ≤ n. . Then (17. fm ). a ≤ m. . fm )| fa . fm | f−xm . n).. fm ) > 1. fm )| f−xm . fm )| f−xm+1 . If it were the case that ( fn . and since the dextral side is an integer. 2 or 34. This implies that ( fn . i. fn ) = ( f9 . Solution: Let d = (17. fn ) = f(9. c = f(m. which obviously must be odd. y cannot be both negative. a contradiction. n+1 n Since 2n + 1 and n + 1 are relatively prime. Find the greatest common divisor of Ç å 2n .. Hence ( fn . n Ç åÇ å Ç å 2n 2n 2n . m|(−xm). fa | fm and fa | fn by Theorem ??. Observe that fyn = fa−xm = fa−1 f−xm + fa f−xm+1 upon using the identity fs+t = fs−1 ft + fs ft+1 of Theorem ??. fn ) = 1. Therefore ( fn . Observe that x. This means that d = (17. fn ) = (34.e. fm ) would be dividing two consecutive Fibonacci numbers. Solution: Set d = ( fn . This forces d = 1. y such that xm + yn = a. y > 0. and we assume without loss of generality that x ≤ 0. we have that fn | fyn . a = (m.m) . 103 Example The Catalan number of order n is deﬁned as Prove that Cn is an integer for all natural numbers n. otherwise a would be negative. 1 3 2n − 1 . Now.. f3 or f9 . As a|n. by the Bachet-Bezout Theorem. Solution: By the binomial absorption identity. n+1 n n+1 104 Example Let n be a natural number. fm ). fn ) = f(n. Ç å 2n 1 Cn = .n) = f1 . which is what we wanted to prove. We will prove that c|d and d|c. fm )| fyn and ( fn .. a contradiction to the preceding problem in the case when ( fn . there are integers x..n) . Thus fa |( fm . fm )| f−xm . As n|yn. fn ).GCD and LCM 101 Example Prove that 37 ( fm . They cannot be both positive since then a = xm + yn ≥ m + n. it must be the case that n + 1 divides Ç å Ç å 2n + 1 2n + 1 2n = . then ( fn . Thus they are of opposite signs. 102 Example Prove that no odd Fibonacci number is ever divisible by 17. fm )| fa f−xm+1 . We saw earlier that ( fn .

where l is the largest 1 power of 2 that divides n. . . . b)[a. B the set of multiples of 3.2 Find lcm (23!41!. then is either of the form 4k or 4k + 2. We may write n = 2l m. b = 2k − 1. 6} . . 2}. . etc. Problem 4.1 Show that (a. 100.38 Solution: Since Chapter 4 å 2n = 22n−1. where M is odd. . 29!37!). 100}. Now. n Ç Solution: Arrange the 100 integers into the 50 sets {1.1. 107 Example How many positive integers ≤ 1260 are relatively prime to 1260? Solution: As 1260 = 22 · 32 · 5 · 7. |A ∪ B ∪C ∪ D| = |A| + |B| + |C| + |D| −|A ∩ B| − |A ∩C| − |A ∩ D| −|B ∩C| − |B ∩ D| − |C ∩ D| +|A ∩ B ∩C| + |A ∩ B ∩ D| + |A ∩C∩ D| +|B ∩C ∩ D| − |A ∩ B ∩C ∩ D| 630 + 420 + 252 + 180 − 210 − 126 − 90 − 84 −60 − 36 + 42 + 30 + 18 + 12 − 6 = 972. or 7. we may choose a = 2. Let A denote the set of integers ≤ 1260 which are multiples of 2. 2k − 1 2k − 1 2k − 2 But 2k − 1 |2l+1 for k > 1. Practice Problem 4. there must be two that will lie in the same set. Ç å Ç å 2l+1 m 2l+1 m 2l+1 m − 1 = . 5. Those two are relatively prime. Solution: If n is odd. This establishes the claim. If n is even. Since the gcd must divide = 2n. By the Inclusion-Exclusion Principle. We claim that 2l+1 divides all of them. as consecutive integers are relatively prime. 106 Example Prove that any natural number n > 6 can be written as the sum of two integers greater than 1. each of the summands being relatively prime. b = n − 2. b] = ab for all natural numbers a. then take a = 2k + 1. {3. {5. 3. Show that there are two that are relatively prime. These two are clearly relatively prime (why?). = The number of integers sought is then 1260 − 972 = 288. . If n = 4k + 2. the problem amounts to ﬁnding those numbers less than 1260 which are not divisible by 2. Since we are choosing ﬁfty one integers.1. we see that it has divide 2l+1 . b = 2k − 1. b. If n = 4k. 2.. k > 1 take a = 2k + 3. 2k − 1 k=1 Ç å 2n a the gcd must be of the form 2 . {99. 105 Example Let any ﬁfty one integers be taken from amongst the numbers 1. 4}.

. Clearly 2 is the only even prime and so 2 and 3 are the only consecutive integers which are prime. c are pairwise relatively prime natural numbers each exceeding 1. b. ∈ N.1. (Hint: Consider n mod 12. . (Hint: Prove k j=0 Ç åÇ å k n+ j (−1) j = (−1)k . What is the largest number of elements in any conspiratorial subset of the integers 1 through 16? 4. Prove that gcd(an . n > 1 with tions: 1.) j k Problem 4. .8 Let the integers an . Problem 4. Find (Fn .) Problem 4. then n is divisible by at least one prime.1. and lcm (a.14 Prove that any natural number n > 17 can be written as n = a + b + c where a. Fm ). b) = 12. n ∈ N. . . b ∈ N with (a.1.4 Find a. b.9 Prove or disprove the following two proposi. . Prove that the greatest common divisor of the numbers Ç åÇ å Ç å equals n n+1 n+k ÇÇ åÇ åÇ åå .1.13 Demonstrate that (n! + 1.. k−1 k+1 k Problem 4.Problem 4. Problem 4.1. It is clear that if n > 1 is composite then we can write n as n = ab. n ≥ k > 0 be integers.Primes Problem 4. An integer different from 1 which is not prime is called composite. (n + 1)! + 1) = 1. 2. Write two of the summands in the form 6k + s and the third summand as a constant. b)n = (an .1.16 Prove that the binomial coefﬁcients have the tive integers there are three whose product is divisible following hexagonal property: by abc. .7 Show that (n3 + 3n + 1. b. b] = 432.6 Let a ∈ N. Problem 4.1. k.1. (an − bn)|(an + bn ).1. Find. b ∈ N. 2. bn ) for all natural Problem 4.12 Find the greatest common divisor of the sequence numbers n. 108 Theorem If n > 1. all b ∈ N such that (2b − 1)|(2a + 1). ÇÇ åÇ åÇ åå n−1 n n+1 gcd . .3 Find two positive integers a.11 Let Fn = 22 + 1 be the n-th Fermat number. n = 1.10 Let n. 7n3 + 18n2 − n − 2) = 1. n Problem 4. then in any set of b consecutive integers there are two whose product is divisible by ab.1. k k k n−1 n+1 n gcd . k k+1 k−1 is 1.2 Primes Recall that a prime number is a positive integer greater than 1 whose only positive divisors are itself and 1. a < b < c.1. bn be deﬁned by the relation √ √ an + bn 2 = (1 + 2)n . [a..5 Prove that (a.17 (Putnam. then in any set of c consecu. b) = 1764. bn ) = 1 ∀ n. with proof. b such that a2 + b2 = 85113. If a. b ∈ N. 39 Problem 4.15 Prove that there are no positive integers a.1. Problem 4. . 1 < a ≤ b < n. If a. 1974) Call a set of integers conspiratorial if no three of them are pairwise relatively prime.Problem 4. Problem 4. . a. 16n + 10n − 1.1.. Problem 4. a < b.1.1. c.

We claim that q is prime. that the set of primes is inﬁnite. Then each of the numbers k! + 2. p2 . √ Solution: Observe that 100 = 10. all the composite numbers in the range 10 ≤ n ≤ 100 have a prime factor amongst 2. Construct the number N = 4p1 p2 · · · pn − 1. in view of the preceding problem. Proof: Let p1 . or 7.u 111 Theorem There are inﬁnitely many primes of the form 4n + 3. We will show that the collection of primes of the form 4k − 1 is inexhaustible. 1 < a ≤ b < q. or is of the form 4k ± 1. N ≥ 11.u 109 Theorem (Euclid) There are inﬁnitely many primes. .. which contradicts the minimality of q. it has at least one divisor > 1. But then a is a divisor of n greater than 1 and smaller than q. . Then |A2 | = 50. i. . Let {p1 . .. 5. k! + k is composite. |A5 | = .e. p2 . a contradiction. In the latter case. . Observe that p must be different from any of p1 . pn } be any ﬁnite collection of primes of the form 4k − 1. We have thus shown that given any ﬁnite list of primes of the form 4k − 1 we can always construct an integer which is divisible by some prime of the form 4k − 1 not on that list. Observe that N is not divisible by any of the primes in our collection. Proof: Any prime either equals 2.40 Chapter 4 Proof: Since n > 1. Proof: (4a + 1)(4b + 1) = 4(4ab + a + b) + 1. then it must have a prime factor p with p ≤ √ n. √ √ √ Proof: Suppose that n = ab. |A3 | = 33. . . For if not then we can write q as q = ab. < √ Thus n has a factor = 1 and ≤ n. . and hence a prime factor. 1√ a ≤ b < n. . . which is ≤ n. say q. p2 . Solution: Let k ∈ N. If both a and b are > n. By the Well Ordering Principle. pk since n leaves remainder 1 upon division by any of the pi . This integer is greater than 1 and so by the preceding problem. in which case it is a prime of the form 4k − 1 not on the list. n must have a least positive divisor greater than 1. then n = ab > n n = n. for the product of any two primes of this form is again of this form.u 110 Lemma The product of two numbers of the form 4k + 1 is again of that form. k ≥ 2. u 112 Example Prove that there are arbitrarily long strings that do not contain a prime number. 113 Theorem If the positive integer n is composite. The assertion follows. pk be a list of primes. u 114 Example Find the number of prime numbers ≤ 100. Thus we have shown that no ﬁnite list of primes exhausts the set of primes. Thus N must be divisible by some prime of the form 4k − 1 not on the list. By the preceding theorem. Since each pk is ≥ 3. . . 3. . Now either N is a prime. it must have a prime divisor p. Let Am denote the multiples of M which are ≤ 100. Construct the integer n = p1 p2 · · · pk + 1. or it is a product of primes. all of the prime factors of N cannot be of the form 4k + 1.

1 Prove that there are inﬁnitely many primes of the form 6n + 5. divides p. Ç å Ç å p p whence p|k! . prove that the prime factorisation of p + q has at least three (not Problem 4. Ç å p 115 Lemma If p is a prime. |A15 | = 6. Prove that Å ã necessarily distinct) primes. it must be the case that p| .6 Prove that 3. By Euclid’s Lemma. Now.3 If p and q are consecutive odd primes. |A21 | = 4.2. as k < p. |A42 | = 2. 5. k Solution: By the Binomial Theorem: Ç å Ç å Ç å p p p 2 − 2 = (1 + 1) − 2 = + + ··· + . 3. b) = 1.u k k Ç å p k! = p(p − 1) · · ·(p − k + 1).2 Use the preceding problem to show that there are inﬁnitely many primes p such that p − 2 is not a prime. Prove. k Proof: Ç å p p(p − 1) · · ·(p − k + 1) = k! k yields 116 Example Prove that if p is a prime. n ∈ Z.2. 2.2. |A210 | = 0. By the preceding lemma. p + 2. |A14 | = 7.2. where we have subtracted the 1. Problem 4. Prove that 42|n7 − n. 7 is the only prime triplet of the form p. |A7 | = 14. n ∈ Z. Prove that 30|n5 − n. p + 4. that p|(n p − n). p |k!. ap + bp a + b.4 1. a+b Problem 4. This establishes 0 p the assertion. |A10 | = 10.2. is divisible by p for all 0 < k < p. 5. Problem 4. Let p be a prime and let n ∈ N. then p divides 2 p − 2. 3. |A70 | = 1. because 1 is neither prime nor composite. |A105 | = 0. 4. Problem 4. by induction on n. . 5. p divides each of the terms on the dextral side of the above.2.Practice 41 20. Prove Fermat’s Little Theorem: if p |n. |A30 | = 3. |A35 | = 2. 1 2 p−1 p p Ç å Ç å p p as = = 1. Extend this result to all n ∈ Z. Thus the number of primes ≤ 100 is = = = = 100 − ( number of composites ≤ 1) − 1 4 + 100 − multiples of 2.5 Let p be an odd prime and let (a. then p|(n p−1 − 1). |A6| = 16. or 7 ≤ 100 − 1 4 + 100 − (50 + 33 + 20 + 14) + (16 + 10 + 7 + 6 + 4 + 2) −(3 + 2 + 1 + 0) − 0 − 1 25. Practice Problem 4.

b]. y) + min(x. 1 2 where the p j are primes. (it may be the case that some of the ak and some of the bk are zero) then n (a.b ) p2 · · · pn n n . we obtain p a1 p a2 · · · p j j 1 2 a −b j j−1 j+1 · · · pas = pb1 pb2 · · · p j−1 p j+1 · · · pbs . a1 > 0. ak > 0. b)[a. By Euclid’s Lemma (example 1. a2 > 0. If a j > b j for some j then.b2 ) min(a . Eventually we then have n = q1 q2 · · · qs . This implies that s = t. Assume that n is composite and let q1 be its least proper divisor.b1 ) max(a2 . We will show now that such decomposition is always possible for a positive integer greater than 1. If n1 is a prime. This ﬁnishes the proof. By Theorem 4. . (4. We cannot further decompose 1332 as a product of positive integers greater than 1.2) we conclude that every p must be a q and every q must be a p. as guaranteed by Theorem 4. . we arrive at a chain n > n1 > n2 · · · > 1.2) Since x + y = max(x. from p1 < p2 < · · · < ps and q1 < q2 < · · · < qt we conclude that p j = q j . then we have nothing to prove. We can write then n = q1 q2 n2 .1) max(a1 . 666 is clearly divisible by 6. Otherwise. 1 ≤ j ≤ s. that if a has the prime factorisation a = p11 pa2 · · · pan and b n 2 b1 b2 has the prime factorisation b = p1 p2 · · · pbn .5. by the Fundamental Theorem of Arithmetic. 111 is also divisible by 3 and so we obtain 1332 = 2 · 2 · 3 · 3 · 37. Continuing the argument. 4.2.5. Now. u a It is easily seen. We call the preceding factorisation of n.42 Chapter 4 Problem 4. 117 Theorem Every integer greater than 1 is a product of prime numbers. y). then the other is composite. 37 are prime. b) = p1 and also [a. For example 23 32 52 73 is the canonical factorisation of 617400. as all 2. (4. 118 Theorem (Fundamental Theorem of Arithmetic) Every integer > 1 can be represented as a product of primes in only a p1 < p2 < · · · < pk . apart from the order of the factors. . as the sinistral side is divisible by p j and the dextral side is not. upon dividing by p j j . 1 < n1 < n. and so 1332 = 2 · 2 · 3 · 111. one way. the alternative a j < b j for some j is ruled out and so a j = b j for all j. 3.3 Fundamental Theorem of Arithmetic Consider the integer 1332.7 Let n > 2. Proof: Let n > 1. It is clearly divisible by 2 and so we obtain 1332 = 2 · 666.b1 ) min(a2 . Assume that n = pa1 pa2 · · · pas = qb1 qb2 · · · qtbt s 1 2 1 2 are two canonical factorisations of n. 1 < n2 < n1 < n. assume that n1 is composite. If n is a prime. Also. . and this process must stop before n steps. Similarly. Prove that if one of the numbers 2n − 1 and 2n + 1 is prime. as n is a positive integer. and let q2 be its least prime divisor. it clearly follows that ab = (a.b2 ) max(an . b] = p1 min(a1 . u We may arrange the prime factorisation obtained in the preceding Theorem as follows. s s 1 2 b b b which is impossible. then we arrived at the result. n = pa1 pa2 · · · pk k .bn ) p2 · · · pn . Finally. q1 is a prime. . Set n = q1 n1 . Proof: We prove that a positive integer greater than 1 can only have one canonical factorisation. the canonical factorisation of n.

Since n2 −1 and n are relatively prime. are integers. This contradicts the Fundamental Theorem of Arithmetic. Solution: Let the integer be (n −1)n(n + 1) = (n2 −1)n. Assume that there is an integer M with p(m) = 14. Since the factors m − ak are all distinct. n2 − 1 and n2 would be consecutive perfect kth powers. √ Solution: Assume that 2 = a/b with relatively prime natural numbers a. etc.). by the Fundamental Theorem of Arithmetic. Then 2b2 = a2 . 121 Example Prove that the product of three consecutive integers is never a perfect power (i. a perfect square or a perfect cube. 120 Example Prove that if the polynomial p(x) = a0 xn + a1 xn−1 + · · · + an−1x + an with integral coefﬁcients assumes the value 7 for four integral values of x. 123 Example Prove that the sum S = 1/2 + 1/3 + 1/4 + · · ·+ 1/n is never an integer. the product of the factors is m5 . and 33 is clearly not a ﬁfth power. 33 can be decomposed as the product of at most four different integers 33 = (−11)(3)(1)(−1).. But then. the factors in the above product are all different.Fundamental Theorem of Arithmetic 119 Example Prove that 43 √ 2 is irrational. as 33 is the product of 4 different factors and the expression above is the product of 5 different factors for n = 0. b. n2 − 1 is a perfect kth power (k ≥ 2) and n is also a perfect kth power. 2 124 Example Prove that there is exactly one natural number n for with 28 + 211 + 2n is a perfect square. Then 7 = p(m) − 7 = (m − a1 )(m − a2)(m − a3 )(m − a4 )q(m). Assume that p(ak ) − 7 = 0 for distinct ak . They cannot be multiply to 33. by the Fundamental Theorem of Arithmetic. except for 2k−1 P k . Solution: Observe that m5 + 3m4 n − 5m3n2 − 15m2n3 + 4mn4 + 12n5 = (m − 2n)(m − n)(m + n)(m + 2n)(m + 3n). The sinistral side of this last equality has an odd number of prime factors (including repetitions). by the Fundamental Theorem of Arithmetic. Now. we have decomposed the integer 7 into at least four different factors. whereas the dextral side has an even number of prime factors.e. If n = 0. then it cannot take the value 14 for any integral value of x.. 122 Example Prove that m5 + 3m4 n − 5m3n2 − 15m2n3 + 4mn4 + 12n5 is never equal to 33. . and P the product of all the odd natural numbers not exceeding n. Solution: First observe that the integer 7 can be decomposed into at most three different integer factors 7 = −7(1)(−1). The 1 number 2k−1 PS is a sum. sheer nonsense. Then p(x) − 7 = (x − a1)(x − a2 )(x − a3 )(x − a4 )q(x) for a polynomial q with integer coefﬁcients. If n = 0. This is impossible. 1 ≤ k ≤ 4. Solution: Let k be the largest integer such that 2k ≤ n. all whose terms.

b][b. [a. From the 1983 integers remaining. βk ) − min(αk . b2 such that a2 b2 = c2 . we associate a vector (a. Solution: Any number in our set is going to have the form 5a 7b 11c 13d 23 f . b. then k2 − 482 = (k − 48)(k + 48) = 2n . c. we may ﬁnd two distinct cm say ci and c j . . Since we have 1985 > 513 numbers. By unique factorisation. 7. γk ) − min(βk . odd. The assertion is equivalent to showing 2 max(αk . a] (a. c)(c. were n is the largest positive integer such that 1985 − 2n ≥ 513. Thus to each number in the set. bk such that ak bk = c2 . These vectors come in 32 different ﬂavours. b. c]2 = . γk ) − max(βk . By symmetry. giving s + t = n = 12. Thus if we gather 513 of these numbers. Since there are only ﬁfty odd integers between 1 and 100. Therefore. without loss of generality. odd. βk . . Solution: Any of the ﬁfty one integers can be written in the form 2a m. according to the parity of the components. γk ) − max(αk . c][c. b1 such that a1 b1 = c2 . βk ) − max(αk . a perfect square. two (at least) will have the same parity in their exponents. . b = pk k . The equation to be established reduces thus to the identity 2αk − αk − αk − βk = 2γk − βk − γk − γk . n = 736. 126 Example (IMO. we can ﬁnd a pair of distinct a2 . f ). 2. k − 48 = 2s . 1985) Given a set M of 1985 distinct positive integers. we may assume. i. 23}.44 Chapter 4 Solution: If k2 = 28 + 211 + 2n = 2304 + 2n = 482 + 2n . b. there are only ﬁfty possibilities for m. c)2 [a. and thus the smaller will divide the larger. we can ﬁnd a pair a3 . . a fourth power. the 737 numbers k ck have all their prime factors smaller than 26. Since we have 33 integers. Now.e. a) Solution: Put a= α β γ pk k . βk . odd) is one such class. we can ﬁnd a pair of distinct a1 . none with a prime factor greater than 26. Show that there must be one that divides some other. Solution: Any number in our set is going to be of the form 2a 3b 5c 7d 11 f 13g 17h 19 j 23k . and since 737 > 513. Thus we have found four distinct numbers in our set whose product is a fourth power. γk ).t − s = 2. k + 48 = 2t . c = pkk . even. b3 such that a3 b3 = c2 . . 11. i = j. 1 Delete this pair. such that ci c j = a2 . Delete this pair. d. prove that M contains a subset of four distinct elements whose product is the fourth power of an integer. b)(b. Thus we may perform this operation n + 1 times. 127 Example Let any ﬁfty one integers be taken from amongst the numbers 1. with primes pk . 2 From the 1981 integers remaining. γk ) − min(αk . But then 2t − 2s = 96 = 3 · 25 or 2s (2t−s − 1) = 3 · 25 . 125 Example Prove that in any set of 33 distinct integers with prime factors amongst {5. For example (even. and the product of these two will be a square. 13. γk ) = 2 min(αk . there must be two whose product is a square. We can continue this operation as long as 3 we have at least 513 integers. we are able to gather 737 pairs ak . where m is odd. s + t = n. that αk ≥ βk ≥ γk . But then ci c j = a2 implies that ai bi a j b j = a4 . we will have two different ones whose product is a square. 128 Example (USAMO 1972) Prove that (a. Start weeding out squares. 100. By unique factorisation. Thus two (at least) of the integers chosen must share the same odd part.. s = 5.

n+1 . writing ak = 2tk Ak .. are clearly distinct. This implies that l < 4 and so n < 49. b. s < 2k+1 . + m is never divisible by n. n − 1. 1 2 k k +1 Clearly then K = pk1 pk2 · · · pl l . a j ] = 2t j 3A1 = a j ≤ 2n. nl/2 < n2 . a. M must equal Ç å 4 2 r for at least two of the four numbers. 3A1 = A j for some j. By inspection. and 3A1 < 2n. and n must equal s for at least two of the four numbers. c. 24. Solution: Set n = s2k with s odd. 133 Example (Putnam. pl be all the primes ≤ n. . with 0 < l < m < n. Moreover. The sequence n/2 + 1. cannot be divisible by 2n = 2k+1 . s > 2k+1 . so that at least once ar − a1 = a j . Clearly nl/2 < pk1 +1 pk2 +1 · · · pl l . 4. 130 Example (Irving Kaplansky) A positive integer n has the property that for 0 < l < m < n. 2. Consequently. d. These contradictions establish the assertion. √ √ Solution: Suppose n is divisible by all the integers ≤ n. Let p1 = 2. c] = [b. give 2k − 1 > n positive integers. . its even factor is less than 2n. 1 ≤ a ≤ 45 √ n.Fundamental Theorem of Arithmetic 129 Example Prove that n = 24 is the largest natural number divisible by all integral a. . . and let k j be the √ √ √ k k +1 k +1 unique integers such that p j j ≤ n < p j j . . Solution: The k − 1 positive integers ai − a1. 3 Solution: It is clear that no one of the numbers can divide another (otherwise we would have an lcm ≤ 2n). 1 + m − s. . . p2 = 3. . and a j = 2t j 3A1 . 0 ≤ n ≤ s. then 3a1 = 2t1 3A1 ≤ 2n. . 132 Example Let 0 < a1 < a2 < · · · < an ≤ 2n be integers such that the least common multiple of any two exceeds 2n. Hence pk1 +1 pk2 +1 · · · pl l ≤ K 2 and thus nl/2 < K 2 . n ) = K. Solution: By unique factorisation. Let lcm(1. By hypothesis. together with the k given distinct a’s. be integers. shows that for k = (n + 1)/2 the result is false. at least one of the integers is common to both sets. . then S is divisible by n. . d) such that 3r 7s = [a. we see that all the Ak are different. each of a. d] = [c. n must be divisible by K 1 2 1 2 and so K ≤ n. If s = 1. Hence. . 1980) Derive a formula for the number of quadruples (a. Thus either [a1 . Ak odd. . we see that the only valid values for n are n = 2. or [a1 . Hence. Now. a] = [d. consider a1 = 2t1 A1 . c. Since there are n of them. since. which has one factor even and one factor odd. 3. Prove that this is possible if and only if n is a power of 2. b]. 2S = (l + m)(m − l + 1). S = l + (l + 1) + . Prove that 2 131 Example Let 0 < a1 < a2 < · · · < ak ≤ n. Since 3A1 would then be an odd number < 2n. 12. But if s > 1. they coincide in some order with the set of all positive odd numbers less than 2n. There are r = 6r2 ways 2 . 0 ≤ m ≤ r. 2 ≤ i ≤ k. b. each not greater than n. 6. d must be of the form 3m 7n . These. if we take m = (s + 2k+1 − 1)/2 and l= ® 1 + m − 2k+1. where k > a1 + a j = ar is soluble. c. Prove that a1 > 2n . n/2 + 2. a j ] = 2t1 3A1 = 3a1 ≤ 2n. n. 8. b. If a1 ≤ 2n/3 .

.7 (AIME 1987) Find the number of ordered triples (a. c] = 2000. then t is prime. divides at most one of the N pk .3. . for which p j > n − j + 1.3 Find the smallest positive integer such that n/2 is a square and n/3 is a cube. . There is a t.10 Let n = pa1 pa2 · · · ptat and m = pb1 pb2 · · · ptbt . . 1 < j < n. Practice Problem 4. . 1 ≤ k≤ j 2. 4. Problem 4. pt be different primes and Problem 4. Problem 4. .5 Prove that the sum 1/3 + 1/5 + 1/7 + · · ·+ 1/(2n + 1) is never an integer.3. p2 < p1 · · · pn . such that all of p1 . .3.3. Answer: 2t−1 − 1.3. Similarly. n) = 1. Factorisations differing in order are considered the same. at be natural numbers. 1 ≤ t ≤ ps . pn fail to divide t p1 p2 · · · ps−1 − 1. (Hint: Look at the largest power of 3 ≤ n).3. b. . (Bonse’s Inequality) For n ≥ 4.9 Let p1 .3.1 Prove that log10 7 is irrational. c] = [a. there are 1 + 4s + 6s2 ways of choosing at least two of the four numbers to have exponent s. b] = 1000. . Factorisations differing in order are considered the same. 3 = p2 . r = 4r ways of choosing exactly three to have exponent 3 Ç å 4 r and = 1 of choosing the four to have exponent r. k≥1 factoring pa1 pa2 · · · ptat as the product of two positive relatively 1 2 prime factors each greater than 1. Answer: 3.6 Find min 36k − 5k . bk )).12 Let 2 = p1 . . p2 . j ≤ i ≤ n. . a2 . . There is a j.11 (USAMO 1973) Show that the cube roots of three distinct prime numbers cannot be three terms (not necessarily consecutive) of an arithmetic progression. Each pi . .3.3. 3. c) of positive integers for which [a. Problem 4.46 Chapter 4 Ç å 4 of choosing exactly two of the four numbers to have exponent r. are not perfect squares. perfect cubes.4 How many integers from 1 to 1020 inclusive. n+1 Problem 4. Problem 4.3. Answer: t (1 + min(ak .2 Prove that log 3 log 2 is irrational. Problem 4.8 Find the number of ways of factoring 1332 as the product of two positive relatively prime factors each greater than 1. Thus there is a total of 1 + 4r + 6r2 of choosing at least two of the 4 four numbers to have exponent r. be the primes in their natural order and suppose that n ≥ 10 and that 1 < j < n. [b. Set N1 = p1 p2 · · · p j−1 − 1. 1. Problem 4. The s above is > 4 and so ps−1 − 2 ≥ s and p1 p2 · · · ps < ps+1 · · · pn . and Prove N p j = p j p1 p2 · · · p j−1 − 1 (Hint: Why is 36k − 1 − 5k = 0?) Problem 4. . k=1 Problem 4. The required formula is thus (1 + 4r + 6r2)(1 + 4s + 6s2). and hence pn+1 < p1 p2 · · · ps . . Find the number of ways of following property: if 1 ≤ t ≤ n and (t.3. Let s be the smallest j for which p j > n − j + 1. . 5.3. Find the number of the common factors of m and n. or perfect ﬁfth powers? Problem 4. 1 2 1 2 the p’s being different primes. Problem 4. N2 = 2p1 p2 · · · p j−1 − 1. .13 Prove that 30 is the only integer n with the a1 .3.

3. Prove that Problem 4. Is there an inﬁnite set S of distinct positive integers such that the geometric mean of any ﬁnite subset of S is an Problem 4. 0) for which √ √ Problem 4.Practice Problem 4. . whose difference. c be integers. c. . b. except for (a. b.17 Prove that from any sequence formed by arranging in a certain way the numbers from 1 to 101. it is alinteger. not all zero and each of absolute value less than a million. a2 . triplet of integers (a. ways to choose two.3. ways possible to choose 11 numbers (which must not necessarily be consecutive members of the sequence) which form an Problem 4.3. then n is a multiple of 4. xn each of which √ √ is equal to ±1. .16 (E˝ tv˝ s 1906) Let a1 . (Putnam 1980) Let a. (Putnam 1955) Prove that there is no increasing or a decreasing sequence. x2 . . prove that if |a + b 2 + c 3| > 10−21 . or else. divisible by 100. . n. such that Problem 4. (Putnam 1980) Prove that there exist integers a.3.3.3. the x1 x2 + x2 x3 + · · · + xn x1 = 0. .14 (USAMO 1984) 1. whose sum. b. one |a + b 2 + c 3| < 10−11 . b. .18 Prove that from any ﬁfty two integers it is ala + b 2 + c 3 = 0.19 Prove that from any one hundred integers it √ √ is always possible to choose several numbers (or perhaps. an be any pero o mutation of the numbers 1. is 2. number) whose sum is divisible by 100. For which positive product integers n is there a ﬁnite set Sn of n distinct positive (a1 − 1)(a2 − 2) · · · (an − n) integers such that the geometric mean of any subset of is an even number. 0. .15 1. . . Problem 4.3. Prove that if n is odd. . Sn is an integer? 47 2. 3. .20 Given n numbers x1 . 2. c). not all zero and each of absolute value less than a million. . c) = (0.

. it follows that d|(a + nb). . b) = (a + nb. and cannot contain more than b positive terms. b). After using the Division Algorithm repeatedly. It is called the Euclidean Algorithm and it is described as follows. b be positive integers. 18) = (2. c = (a + nb. d|b. The Euclidean Algorithm rests on the fact. 246) = (13 · 246 + 158. 246). 246) = 2. b). 88) = (18. n are positive integers. u 135 Example Use Theorem ?? to ﬁnd (3456. implying that c|d. . rn ) = rn . Proof: Set d = (a. r2 q2 + r3 r3 q3 + r4 . . c|b imply that c|((a + nb) − nb) = a. since b. 16) = 2. b). r3 . r3 ) = · · · = (rn−1 . . As d|a. 70) = (16.Chapter 5 Linear Diophantine Equations 5. c|(a + nb). 134 Theorem Prove that if a. then rn = (a. by the preceding example. . b. This completes the proof. Hence (3456. 136 Theorem If rn is the last non-zero remainder found in the process of the Euclidean Algorithm. 0 < rn < rn−1 . that (a. to be proved below. (158.1) The sequence of remainders will eventually reach a rn+1 which will be zero. Thus c is a common divisor of a and b. is a monotonically decreasing sequence of integers. Let a. (88. 158). . 246). 0 < r3 < r2 . 0 < r4 < r3 . . r2 ) = (r2 . . 246) = (158. This implies that d|c. b) = (b. (5. Solution: (3456.1 Euclidean Algorithm We now examine a procedure that avoids factorising two integers in order to obtain their greatest common divisor. Thus d is a common divisor of both (a + nb) and b. On the other hand. b). we ﬁnd the sequence of equalities a b r2 . 246) = (158. then (a. rn−2 rn−1 = = = . = = bq1 + r2 . . 0 < r2 < b. 48 . Now. Finally. rn−1 qn−1 + rn rn qn . 158 + 88) = (88. r2 . 158) = (70. . .

This gives the desired result. 6 = 29 · 1 − 23. Hence. Solution: We have 29 = 1 · 23 + 6. we see that the linear diophantine equation ax + by = c has a solution in integers if and only if (a. . rn |r2 . rn |a. 23(−35) + 29(28) = 7. Solution: From the preceding example. y that satisfy the linear diophantine equation 23x + 29y = 1. From the ﬁrst equation. 23(−5) + 29(4) = 1. 138 Example Find integers x. b). 23x + 29y = 7. From the second equation. 23 = 3 · 6 + 5. = a − bq1 b − r2q2 r2 − r3 q3 . The last non-zero remainder is 1. The Euclidean Algorithm is an efﬁcient means to ﬁnd a solution to this equation.Euclidean Algorithm Proof: From equations ?? r2 r3 r4 . Thus rn is a common divisor of a and b and so rn |(a. rn−2 − rn−1 qn−1 49 Let r = (a. 139 Example Find integer solutions to 5 = 23 − 3 · 6. . thus (23. . b)|c. Multiplying both sides of this equality by 7. which solves the problem. 29) = 1. . y = 4. we see that rn |rn−1 . Upon iterating the process. . But starting at the last equation ?? and working up. . 29) by means of the Euclidean Algorithm. rn |b. r|r2 . 6−1·5 6 − 1 · (23 − 3 · 6) 4 · 6 − 1 · 23 4(29 · 1 − 23) − 1 · 23 4 · 29 − 5 · 23. with x = −5. r|r3 . rn = = = . b). Solution: We work upwards. . 6 = 1 · 5 + 1. . 1 = = = = = This solves the equation. . By the Bachet-Bezout Theorem. . starting from the penultimate equality in the preceding problem: 1 = 6 − 1 · 5. An equation which requires integer solutions is called a diophantine equation. rn |rn−2 . 5 = 5 · 1. we see that r|rn . u 137 Example Find (23.

We can ﬁnd a family of solutions by letting x = −5 + 29t. c are integers such that (a.t ∈ Z. From this b a a ′ (x − x0 ) = t .1. 246) = 2 and 2 |73. Then given any solution (x0 . 600) 3. 142 Theorem Assume that a. y = 4 − 23t. 3456(−1) + 246(15) = 234. y = y0 − ta/d is also a solution. b). the pair x0 = −5. y′ ) satisfy ax′ + by′ = c. d d d which is to say x′ = x0 + tb/d. 36) Problem 5. By Theorem ??. we have a(x′ − x0 ) = b(y0 − y′ ). d d where d = (a. y0 ) is a solution of ax + by = c. d d that is. y = 15 − 1728t. b. a a |(y0 − y′ ). (4554. provided solutions exist: 4.50 140 Example Find inﬁnitely many integer solutions to Chapter 5 23x + 29y = 1. (34567. This ﬁnishes the proof. in virtue of Euclid’s Lemma.1. Solution: By Example ??. Thus there is an integer t such that t = y0 − y′ . b) and t ∈ Z. 8173826342) . then x = x0 + tb/d. all the solutions are given by x = −1 + 123t. y0 = 4 is a solution. y0 ) of the linear diophantine equation ax + by = c any other solution of this equation will have the form b a x = x0 + t . y such that 3456x + 246y = 73? Solution: No. Let (x′ . Practice Problem 5. As ax0 + by0 = c also. (3456. d d Since (a/d. (8098643070. Let us prove that any solution will have this form. 141 Example Can you ﬁnd integers x. y = y0 − t . u 143 Example Find all solutions in integers to 3456x + 246y = 234. b)|c. Proof: It is clear that if (x0 .1 Find the following: 1. y = y0 − ta/d. Dividing by d = (a. (560.2 Solve the following linear diophantine equations. t ∈ Z. a ′ b (x − x0 ) = (y0 − y′ ). 987) 2. b/d) = 1. Solution: By inspection.

0). n) incongruent solutions mod n. how many eggs and how many bananas did the woman buy? 5. We ﬁrst solve the linear diophantine equation 5x + 7y = 1. since the absolute difference between any two of them is less than n. If the congruence ax ≡ b mod n has a solution. then it has (a. n)|b. Thus every solution of the congruence ax ≡ b mod n is congruent mod n to one and only one of the d values x0 + nt/d.35. b. (x.78 for some bananas and eggs. y) is |by − ax| . y = y0 − at/d.1. then there are d incongruent solutions mod n. 2 51 Problem 5. where x0 . 3x ≡ 6 mod 12. Thus x ≡ 2 mod 7.u 145 Example Find all solutions to the congruence 5x ≡ 3 mod 7 Solution: Notice that according to Theorem ??. 24x + 25y = 18 2. 146 Example Solve the congruence 5·1+2 2·2+1 2 · 1. d = (a. ax ≡ b mod n is soluble if and only if the linear diophantine equation ax + ny = b is soluble. Hence. 0 ≤ t ≤ d − 1. 1998x + 2000y = 33 Problem 5. . n) − 1). 7) = 1. ((a. 144 Theorem Let a. y0 satisfy ax0 + ny = b. If x = x0 + nt ′ /d is any other solution.Linear Congruences 1. 0 ≤ r < d.3 Prove that the area of the triangle whose vertices are (0. By the Euclidean Algorithm 7 = 5 = 2 = Hence. Whence 3 = 5(9) − 7(6). Proof: From Theorem ?? we know that the solutions of the linear diophantine equation ax + ny = b have the form x = x0 + nt/d.1. as (5. n be integers. n) mutually incongruent solutions. . Thus if there is a solution to the congruence. Then x = = ≡ x0 + n(qd + r)/d x0 + nq + nr/d x0 + nr/d mod n. .2 Linear Congruences We recall that the expression ax ≡ b mod n means that there is t ∈ Z such that ax = b + nt. This gives 5 · 9 ≡ 3 mod 7 which is the same as 5 · 2 ≡ 3 mod 7. there should only be one solution mod 7.4 A woman pays $2. 1 2 which gives 1 = 5 − 2 · 2 = 5 − 2(7 − 5 · 1) = 5 · 3 − 7 · 2. we obtain (a. (b. the congruencial equation in x. n). we write t ′ as t ′ = qd + r.t ∈ Z. 3456x + 246y = 44 3. = 5−2·2 = 7 − 5 · 1. If each banana costs $0. It is clear then that the congruence ax ≡ b mod n has a solution if and only if (a. Letting t take on the values t = 0. . a). 1.69 and each egg costs $0.

If (a. 147 Theorem Let x.u Theorem ?? gives immediately the following corollary. n) = 1. the above congruence implies a fortiori that ax − ay = tn for some integer t. n/(a. n). n) ax ≡ ay mod an . (a. This yields (x − y) a n =s . all the solutions are thus of the form x = 2 + 4t. Problem 5. n)) = 1 by Theorem ??. As (a. Practice Problem 5. the congruence has three mutually incongruent solutions. 6.t ∈ Z. s equals (a − 1)(b − 1)/2. n) Since (a/(a. .52 Chapter 5 Solution: As (3. then x ≡ y mod n. b be positive integers. If (a. 149 Theorem (Frobenius) Let a. b) = 1 then the number of positive integers m that cannot be written in the form ar + bs = m for nonnegative integers r. (a. 12) = 3 and 3|6.2 How many x. By Theorem ??. the three incongruent solutions modulo 12 are t = 2. 1. Then ax ≡ ay if and only if x≡y mod n n . 2. This implies that x≡y Conversely if x ≡ y mod n implies (a. 10. n) divides a. n) upon multiplying by a. 148 Corollary If ax ≡ ay mod n and (a. we must have n |(x − y). b) = 1.3 A theorem of Frobenius If (a. By inspection we see that x = 2 is a solution.1 Solve the congruence 50x ≡ 12 mod 14. We now add a few theorems and deﬁnitions that will be of use in the future. n) mod n . there is always an integer solution to ax + by = n regardless of the integer n.2. y be integers and let a. n) by Euclid’s Lemma (Lemma ??). n) mod Proof: If ax ≡ ay mod n then a(x − y) = sn for some integer s. By letting t = 0.2. This gives the required result. We will prove the following theorem of Frobenius that tells un when we will ﬁnd nonnegative solutions to ax + by = n. (a. (a. b) = d > 1 then the linear form ax + by skips all non-multiples of d. n be non-zero integers. n) (a. (a. 38 ≤ x ≤ 289 satisfy 3x ≡ 8 mod 11? 5.

This contradicts the fact that 0 ≤ y < v < a. Solution: The attainable scores are the nonnegative integers of the form ax + by. w ≤ a − 1. the player receives either a or b points. Consider the inﬁnite array 0 1 2 . . 1971) A game of solitaire is played as follows. a > b).... we must have v = w. We claim that no two distinct multiples of b. −1) and (−2. are to be stacked one on top of another to form a tower 94 bricks tall. then ax+ by = vb −ka for some nonnegative integers x. 152 Example (AIME..u The greatest unattainable integer occurs just above (a − 1)b. If vb −ka were attainable. The line 11x + 8y = 58 passes through (6. b) = 1 yield the two possibilities a = 71. .. The numbers directly below a number n have the form n + ka where k is a natural number.. 3a − 1 . b) = 1. If this were so then we would have vb ≡ wb mod a. By Corollary ?? we obtain v ≡ y mod a. . b) = 1 we invoke Corollary 5. (a − 1)(b − 1) = 70 = 2(35) = 5(14) = 7(10). b = 8. the number of non-attainable scores is (a − 1)(b − 1)/2. b = 8. After each play.. 2a + k . The conditions a > b. 0 ≤ v ≤ a − 1 is non-attainable. . . Hence the number of unattainable numbers is given by a−1 a−1 v=0 j=0 53 vb − j (a − 1)(b − 1) = . Now we show that any number directly above one of the multiples vb. Find a and b. If n > ab −a −b.. there are inﬁnitely many such integers. Clearly all multiples of b are attainable. a − 1 a a + 1 a + 2 . b = 2 and a = 11. It has been noticed that there are thirty ﬁve non-attainable scores and that one of these is 58. so is n + ka. Since 0 ≤ v. Clearly. Each brick can be oriented so it contributes 4′′ or 10′′ or 19′′ to the total height of the tower. On the other hand.. 0 ≤ y < v < a. Since (a.. Hence a(v − w) ≡ 0 mod a. and his score accumulates from play to play.. (a. .. w ≤ a − 1 can belong to the same column.. If (a. which gives the following theorem. if n is attainable. there are (vb − j)/a values above vb. The unique solution is a = 11.. Thus the number of unattainable numbers is precisely the numbers that occur just above a number of the form vb. a + k . a 2 as we wanted to show. Therefore we deduce vb ≡ bv − ka ≡ ax + by mod a which yields bv ≡ by mod a. .. (a. The columns of this array are arithmetic progressions with common difference a. Hence (a. 150 Theorem Let a. 0 ≤ v ≤ a − 1. hence the greatest value that is not attainable is (a − 1)b − a. . . vb and wb with 0 ≤ v. b be relatively prime positive integers. implying thus that if an integer n is attainable so is every integer directly below it. Then the equation ax + by = n is unsoluble in nonnegative integers x..A theorem of Frobenius Proof: Let us say that an integer n is attainable if there are nonnegative integers r. As 58 = 0 · 71 + 2 · 29. s with ar + bs = n. How many different tower heights can be achieved using all 94 of the bricks? . on the j-th column. y for n = ab −a −b. 10) and thus it does not pass through a lattice point in the ﬁrst quadrant. 151 Example (Putnam. 1994) Ninety-four bricks. . This implies that y ≡ v mod b. Therefore. b ∈ N... Hence. This yields by ≤ ax + by = vb − ka < vb. according to the outcome. . 2a − 1 2a 2a + 1 2a + 2 . By Theorem ??. .1 to deduce v − w ≡ 0 mod a. Now.. each measuring 4′′ × 10′′ × 19′′ . the ﬁrst alternative is dismissed. b) > 1. k . then the equation is soluble in nonnegative integers.. For a number directly above vb is of the form vb −ka for some natural number k. y. two numbers on the same column are congruent mod a.

n ≤ 180. 1991 181m 11m 1991 r s and r. ab ab bcx + acy + abz. 2. n a b n a b = + does the trick.3. Solution: (a) If (∗) holds then But n = 170 does not satisfy (∗). (a. every integer ≥ (2 − 1)(5 − 1) = 4 can be written in the form 2y + 5z. By Theorem ?? there are (3 − 1)(5 − 1)/2 = 4 exceptions. r) = (b.3. and (∗) follows.5 (IMO. 1995) What is largest positive integer Evaluate that is not the sum of a positive integral multiple of 42 and a positive composite integer? ax + by = n.2 (AIME. that is 2y + 5z ≤ 470. c be positive real numbers. y. Then the number Problem 5. 463. s1 |r1 . but 170m < 181. b with (∗) 1 ≤ m ≤ 10. 4. 466. For mn > 181 except if m = 1. a ≥ 1. b ∈ N. b ≥ 1. y + z ≤ 94. s = 11s1 and then nr1 s1 = 11as1 + 181br1. which leads to r1 |11as1 and so r1 |s1 . 7. whence r1 = s1 = m. each ≤ 8. 468.3. we count the number of different nonnegative integral solutions to the inequality 376 + 3(2y + 5z) ≤ 1786.3. y ≥ 0. so b ≡ m mod 11. Similarly. Using x = 96 −x−y. and 19′′ respectively. which yields b ≥ m. Find the largest positive rational with denominator 1991 that cannot be written as the sum of two positive rationals each with denominators less than 1991.3 Let a > 0. n→∞ lim S(n) . By Theorem ??. Problem 5. b) = 1. Thus of the 471 nonnegative integers n ≤ 470. but then n would not be of the form n ≡ 181 mod 11. s) = 1. namely n = 1. z ≥ 0. and the number of exceptions is (2 − 1)(5 − 1)/2 = 2. Demonstrate that 2abc − ab − bc − ca is the to largest integer not of the form n n [ ] or [ ] + 1. we may suppose r = 181r1 . b > 0.54 Chapter 5 Solution: Let there be x. we see that 469 can be written in the form n = 2y+ 5z. y ≥ 0. x + y + z = 94.1 Let a. b. namely n = 1 and n = 3. ax + by ≤ c. Let S(n) denote the there are at least c2 /2ab pairs of integers (x. b) = 1. say. c be pairwise relatively of nonnegative solutions to the equation ax + by = n is equal prime integers. b ≥ 1. 1991) = 1 satisﬁes (∗) with b = 1 and M such that mn is of the form mn ≡ 181 mod 11. (a.3. x ≥ 0. z bricks of height 4′′ . This means that 463. 0 ≤ n ≤ 470 except for 1. 1991) = 1. 466. 2. 468. 4 ≤ n ≤ 470 will be “good” only if we have 470 − n = 3x + 5z. for we would have 170 ≡ 181b mod 11. 1983) Let a. Then every integer n. Prove that 1991 only if there exist integers m. (n. 4x + 10y + 19z ≤ 19 · 94 = 1786. a. and 469 are not representable in the form 4x + 10y + 19z. n Problem 5. y) satisfying number of nonnegative solutions to x ≥ 0. and the number of different sums is 471 − 6 = 465. Now. n. z ≥ 0. Letting x = 94 − y − z. Practice Problem 5. 10′′ .4 Let a. and 469 can be thus represented. (b) Any n > 170. s < 1991.) . if = + for a. Let (n. We are asking for the number of different sums 4x + 10y + 19z with the constraints x ≥ 0. (a. b. (Hint: [s] − [t] = [s − t] or [s − t] + 1. y + z ≤ 94. Prove that Problem 5. The answer is thus 170/1991. mn = 11a + 181b. y ≥ 0. 3. Conversely. 153 Example n is the sum of two positive integers with denominator < 1991 if an 1.

. x ≡ 4 mod 11. . One veriﬁes that all the numbers x = 18 + 55t.t ∈ Z verify the given congruences. i. mod 5. mod 7. . mk be pairwise relatively prime positive integers. ak be arbitrary integers. Consider the following problem: ﬁnd an integer x which leaves remainder 2 when divided by 5. . x ≡ 0 mod 7.. we have 11x = 33 + 55a. 1 ≤ j ≤ k. . . In the language of congruences we are seeking x such that x ≡ 2 mod 5. As n = 21n − 20n. This number clearly satisﬁes the conditions of the theorem. is divisible by 7. 154 Example Find x such that x≡3 mod 5 and x ≡ 7 mod 11. Thus all n ≡ 106 mod 140 will 156 Theorem (Chinese Remainder Theorem) Let m1 . One may check that x = 147 satisﬁes the requirements. This implies that do. x has a unique solution modulo m1 m2 · · · mk . This means that x ≡ −37 ≡ 18 mod 55.4 Chinese Remainder Theorem In this section we consider the case when we have multiple congruences. mod 140. a2 . and that in fact. and when divided by 7 leaves remainder 1. m2 . The uniqueness of the solution modulo m1 m2 · · · mk can be easily established. when divided by 5 leaves remainder 1. and let a1 . ≡ ≡ . . ak mod m1 mod m2 mod mk Proof: Set Pj = m1 m2 · · · mk /m j . Solution: We want n such that n≡ 2 n≡ 1 n≡ 1 35n ≡ 28n ≡ 20n ≡ 70 28 20 mod 4. Form the number x = a1 P1 Q1 + a2 P2 Q2 + · · · + ak Pk Qk . We will develop a method to solve congruences like this one. u . . and it is thus called the Chinese Remainder Theorem. mod 140. As x = 7 + 11b. each exceeding 1. Solution: Since x = 3 + 5a. Thus x = 11x − 10x = 33 − 70 + 55a − 110b.Chinese Remainder Theorem 55 5. we have n ≡ 3(35n − 28n) − 20n ≡ 3(70 − 28) − 20 ≡ 106 mod 140.e. ≡ a1 a2 . mod 140. 155 Example Find a number n such that when divided by 4 leaves remainder 2.t ∈ Z. Let Q j be the inverse of Pj mod m j . so does the parametric family x = 147 + 385t. Then the system of congruences x x . . . and leaves remainder 4 when divided by 11. . The method is credited to the ancient Chinese. . which we know exists since all the mi are pairwise relatively prime. we have 5x = 35 + 55b. Pj Q j ≡ 1 mod m j .

. . x + 1000000 are a million consecutive integers. 4x ≡ 3 mod 7. x x . 2 2 mod p1000000. x ≡ −1 mod 4.4. Let p1 . ≡ −1 −2 . By the Chinese Remainder Theorem. x ≡ 10 mod 11 3. . . Do there exist twenty-one consecutive integers each of which is divisible by one or more primes p. 2 ≤ p ≤ 11? 2. 5x ≡ 2 mod 8. . . p1000000 be a million different primes. 1 mod p2 . 2 ≤ p ≤ 13? .1 Solve the following systems: 1. x ≡ 2 mod 5 2. . . The numbers x + 1.2 (USAMO 1986) 1. x ≡ ≡ .56 157 Example Can one ﬁnd one million consecutive integers that are not square-free? Chapter 5 Solution: Yes. Practice Problem 5. x ≡ 0 mod 11 Problem 5. . . x + 2. . . −1000000 mod p2 . . 3x ≡ 2 mod 9. . . . each of which is divisible by the square of a prime. p2 .4. Do there exist fourteen consecutive positive integers each of which is divisible by one or more primes p. . there exists a solution to the following system of congruences.

We also call this function the ﬂoor function. to denote the fractional part of x. and ||x|| = min |x − n| to denote the distance of a real number to its nearest integer. which. n n This yields the required result. This proves the inequalities. a ∈ Z. we deduce by (1) that α = n α /n + nθ = n α /n + nθ . 3. α + β . which is what we wanted. can also be written as x ≤ x < x + 1. β − 1 < β ≤ β we get α + β − 2 < α + β ≤ α + β . Since α + β is an integer less than or equal to α + β . Write α /n as α /n = α /n + θ . Hence m − a ≤ α < m − a + 1. it must be less than or equal to the integral part of α + β . 2. we obtain α α = + Θ.1 Greatest Integer Function The largest integer not exceeding x is denoted by x or x . 0 ≤ nθ ≤ nθ < n. Now. We obtain thus α + β ≤ α + β . α + β is less than the integer α + β + 2. but α + β < α + β + 2 yields α + β ≤ α + β + 1. Also. 3. β ∈ R.e. u 57 . This means that m − a = α . The greatest integer function enjoys the following properties: 158 Theorem Let α . We also utilise the notation {x} = x − x . n ∈ N. A useful fact is that we can write any real number x in the form x = x + {x}. and so 0 ≤ nθ /n < 1. Then m ≤ α + a < m + 1. α +a = α +a α = n α n α + β ≤ α +β ≤ α + β +1 Proof: 1.Chapter 6 n∈Z Number-Theoretic Functions 6. Let m = α + a . so its integer part α + β must be less than α + β + 2. 0 ≤ Θ < 1. is often of use. i. The fact that x is the unique integer satisfying these inequalities. of course. From the inequalities α − 1 < α ≤ α . Thus x satisﬁes the inequalities x − 1 < x ≤ x. If we let Θ = nθ /n. 2. 0 ≤ θ < 1. 0 ≤ {x} < 1. Then 1. Since n α /n is an integer.

If m ≥ 2n +1. then 2n ≥ ( 2n +1) ≥ 2n+1. Solution: We claim that 3[2t] − 2[3t] = 0. √ √ √ √ √ 2n ). y) = (3x − 2y)(3x − 2y − 1)(3x − 2y + 1)(3x − 2y + 2). let n = triangular numbers. and so 3 2t − 2 3t = 0. then both 2t and 3t are = 0. If t ∈ [1/3. and for n even 2N := (1 + 2)n + (1 − 2) = (1 + 2)n + 1. 1). It must be the case that m = 2n . and so 3 2t − 2 3t = 1. 1) as [0. 1/3). 160 Example Describe all integers n such that 1 + √ 2n 2n. then [2t] = 1. we observe that x has unit period. If t ∈ [1/2. it must be the case that (1 − 2)n is the fractional part of (1 + 2)n or (1 + 2)n + 1 √ √ √ √ depending on whether n is odd or even. y) such that Chapter 6 P( 2t . Since l < 2n < l + 1. and so (1 + 2)n = 2N − 1. Conversely. 162 Example Prove that the ﬁrst thousand digits after the decimal point in √ (6 + 35)1980 are all 9’s. [3t] = 1. (1 (1 √ n √ n √ n whence (1 + √2) + (1 − 2) = (1 + 2)n . So all the integers with the required property are the . then 2t = 1. We divide [0. If t ∈ [0. Since −1 < 1 − 2 < 0. If m ≤ √2n − 1 then 2n ≤ ( 2n − 1)( 2n + 1) = 2n 2 − 1 ≤ 2n − 1 < 2n. 1). 1). 1) = [0. Solution: By the Binomial Theorem Ä √ än 1+ 2 Ç å n (2) := 2N. Solution: Reasoning as in the preceding problem. another contradiction. 3t ) = 0 for all real t. and so 3 2t − 2 3t = −2. √ √ (6 + 35)1980 + (6 − 35)1980 = 2k. l = 2 161 Example Prove that the integers with n a nonnegative integer. 2/3). 2k k √ √ (1 + 2)n + (1 − 2)n = 2 0≤k≤n/2 √ √ √ √ an even integer. 3t = 2. (1 + 2)n − 1 <√ + 2)n + (1 − 2)n < √ + 2)n . always even. 1/3) ∪ [1/3. 2/3) ∪ [2/3. are alternately even or odd. 1/2) then [3t] = 1 and [2t] = 0. and 3 2t − 2 3t = −1. We can then take P(x. always odd for even n. so it is enough to prove the claim for t ∈ [0.58 159 Example Find a non-zero polynomial P(x. Thus for odd n. ±1 or −2. 1/2) ∪ [1/2. √ √ l(l + 1) 2n . If t ∈ [2/3. a Solution: Let 2n = m(1 + √ √ 2 2 contradiction. . In order to prove the claim.√ respectively.

f ( f (m)). Solution: Observe that a = b if and only if ∃k ∈ Z with a. that is to say. 0 ≤ j ≤ k and the set B with all those m’s with excess j. 10 1979 nines This proves the assertion of the problem. we have nothing to prove. . If j = 0. m2 − m. so √ √ 4n + 2 = 4n + 3 . (for if 10 √ hence 0 < (6 − 35)1980 < 10−1980 which yields √ 1 2k − 1 + 0. But 0 < 6 − 35 < 1/10. 2 165 Example (Putnam 1983) Let f (n) = n + √ n . Prove that for every positive integer m. There is a natural number m such that m2 < Tn < (m + 1)2 . 1 1 Since n. Hence. √ √ √ √ 4n + 1 < n + n + 1 < 4n + 3. 0 ≤ j ≤ 2k. the sequence m. This means that either f (m) is a square or f (m) ∈ A. Assume that m ∈ B. (1 + 21)). At each iteration the excess will reduce and eventually it will hit 0. . f (m).9 . . whence we reach a square. the set A of all the m with excess j. f ( f ( f (m))). 2 2 2 . As m = k. 164 Example Find a formula for the n-th non-square. Split the m’s into two sets. m2 + m + 1 are all integers. and an even integer. these inequalities imply m2 − m + < n < m2 + m + . for x ∈ R. Solution: Let m = k2 + j. contains at least one square of an integer. . and the result follows. Neither 4n + 2 nor 4n + 3 are squares since squares are either congruent to 0 or 1 mod 4. This means that f ( f (m)) is either a square or f ( f (m)) ∈ A with an excess j − 1 smaller than the excess j of m. 9 = 2k − 1980 < (6 + 35)1980 < 2k. with 0 ≤ j − k − 1 ≤ k − 1 < k + 1. in which case m + k = k and f ( f (m)) = f (m + k) = m + 2k = (k + 1)2 + j − 1. (1 − 5)] ∪ [ (1 + 17). it is easy to see that √ √ n+ n+1 = 4n + 2 . we see that Tn = n + m. Thus the n-th non-square is Tn = n + n + 1/2 . 166 Example Solve the equation x2 − x − 2 = x . . k < j < 2k + 1. demonstrate that √ Solution: By squaring. As there are m squares less than Tn and n non-squares up to Tn . Solution: Let Tn be the n-th non-square. f (m) = k2 + j + k = (k + 1)2 + j − k − 1. 163 Example (Putnam 1948) If n is a positive integer. (m − 1/2)2 < 4 4 √ √ 1 2 n < (m + 1/2) .Greatest Integer Function 59 √ √ 1 < 6 − 35. √ Observe that k2 ≤ m < (k + 1)2 = k2 + 2k + 1. upon squaring 3500 < 3481. Solving these inequalities it is easy to see that the solution is thus √ √ √ 1 1 1 x ∈ (−1. b ∈ [k. the given equation has a solution if and only if |x2 − 2x − 2| < 1. We have then m2 < n + m < (m + 1)2 or m2 − m < n < m2 + m + 1. which is clearly nonsense). √ It is thus enough to consider the alternative m ∈ A. But then m = n + . k + 1) which happens if and only if |a − b| < 1.

Since there b k=1 are (a − 1)(b − 1) lattice points in total. n). then = . 0 < m < a. 1 √ < k+1 Summing from k = 1 to k = 10 − 1 we deduce 1 √ < k k=2 The integral is easily seen to be 1998. equals the number of lattice points on the upper half of the rectangle. prove that α .e.e. and their number is shared equally by the halves. 0) to (k. m a kb kb The points Lk = (k. Hence 1998 + 1/10 < The integral part sought is thus 1998. x k dx √ < x 106 −1 k=1 1 √ . (a. y. k 1 √ < 1999. n .. 3 106 106 1 6 k+1 k 106 1 dx √ <√ . Similarly. ). Problem 6.1. when is it true that x y ≤ xy ? [α ] > Problem 6. (0. i.1. a We claim that there are no lattice points on this line. u 168 Example Find the integral part of b−1 1 √ . the assertion follows. Now. ). (a. 0).3 If n > 1 is a natural number and α ≥ 1 is a real number.2 If x. equals the number of lattice points on the a a a−1 kb kb is the number of lattice points on the lower half of the vertical line that goes from (k. 0). This rectangle is split into two halves by the line y = . b 2 Consider the rectangle with vertices at (0. This rectangle contains (a − 1)(b − 1) xb lattice points. b are relatively prime natural numbers then a−1 k=1 Chapter 6 kb = a b−1 k=1 ka (a − 1)(b − 1) = . k k=1 106 Practice Problem 6. i. b). except for the endpoints.1. 1 ≤ k ≤ a − 1 are each on this line. points with integer coordinates. b).1 Prove that for all real numbers x. a contradiction. k k=1 Solution: The function x → x−1/2 is decreasing. a a Proof: k=1 ka rectangle. Thus for positive integer k. 0 < n < b. For if there were a lattice point n b (m. x + x + y + y ≤ 2x + 2y holds. y real numbers. Thus n/m is a reduction for the irreducible fraction b/a.60 167 Theorem If a.

4. 2k+1 k=0 Problem 6. b 2 2 Problem 6. Prove that [α ] + [−α ] = −1 or 0 and that α − 2 α /2 = 0 or 1. 3. where the summation runs through all positive integers x not divisible by the mth power of an integer exceeding 1.1. β ] be an interval which contains no sand positive integers can be expressed in the form integers.22 A triangular number is a number of the form 1+2+· · ·+n.1.1.1. min(k + n/k ) = k∈N Problem 6. n.6 Prove that √ (2 + 3)n is an odd integer. 4. Prove that n N= k=1 n =2 k √ 1≤k≤ n √ 2 n − n .1.1. 4. 1≤n≤b−1 Problem 6. Prove where there are n occurrences of the integer n is 2n + 1/2 . .1. prove that = y .23 (AIME 1985) How many of the ﬁrst thouProblem 6.1. n n n Problem 6. 5. b are odd.15 (Putnam 1973) Prove that if n ∈ N.1. 61 Problem 6. that r r 2 − x2 + 4 √ 2 . prove that ab b ≥a .18 Let d = (a. 5. 5. d are positive real numbers such that Problem 6. b).16 (Dirichlet’s principle of the hyperbola) Let N be the number of integer solutions to xy ≤ n. the equality m+n n−m+1 + =n 2 2 holds. b. 2.1. c.1.21 For which natural numbers n will 112 divide √ 4n − (2 + 2)n ? Problem 6. .11 If n is a natural number.1. 3. n ∈ N.12 Solve the equation x x = . Problem 6.17 (Circle Problem) Let r > 0 and let T denote √ the number of lattice points of the domain x2 + y2 ≤ r2 . then an (a − 1)(b − 1) bn + = . x x a + b = c + d.1.14 (IMO 1968) For every natural number n. Prove that an (a − 1)(b − 1) d − 1 = + .19 (Eisenstein) If (a. 5.1.20 Let m ∈ N with m > 1 and let y be a positive na + nb = nc + nd real number. b) = 1 and a. b. T = 1+4 r +8 Problem 6. 25 Problem 6. b a 4 1≤n≤(b−1)/2 1≤n≤(a−1)/2 Problem 6. 1994 1995 Problem 6. Find a formula for the nth non-triangular number. Prove that there is a positive integer n such that [nα . 5.1. n n Problem 6.1. Problem 6.1. Problem 6.8 Prove Hermite’s Identity: if x is a real number √ 2 0<x≤r 2 and n is a natural number then nx = x + x + 1 2 n−1 + x+ + ···+ x + . n are positive integers.1.1. Problem 6. k Problem 6. nβ ] still contains no integers but has length at least 1/6.1. Prove that … y m for all natural numbers n. .5 Let α be a real number. prove that n + 2 − n/25 3 = 8n + 24 . 3. √ 4n + 1 .4 If a.7 Show that the n-th element of the sequence 1. y > 0. 2.9 Prove that for all integers m. evaluate the sum ∞ n + 2k . 2x + 4x + 6x + 8x ? .10 If a. x > 0.13 Let [α .Practice Problem 6. 4.

Problem 6.34 (Putnam 1976) Prove that ã Å n 2n −2 = ln 4 − 1. pk Proof: The number of integers contributing a factor of p is n/p . Prove that » √ k x = k x .31 (AIME 1995) Let f (n) denote the integer closest to n1/4. etc. Problem 6. . 1 n n lim dx = log3 (4/π ).1. 2x. 100 k=19 Find the value of 100r . . ? 1980 1980 1980 Problem 6.u 170 Example How many zeroes are at the end of 300!? .27 (Leningrad Olympiad) How many different integers are there in the sequence 12 22 19802 .1. is Tn = n + ln(n + 1 + ln(n + 1) ) .. 1 3 3 5 5 7 7 9 2 Problem 6.35 (Putnam 1983) Prove that x.1.. .1. n→∞ n 1 x 2. You may appeal to Wallis Product Formula: 3. f (n) n=1 Problem 6.24 (AIME 1987) What is the largest positive integer n for which there is a unique integer k such that 8 n 7 < < ? 15 n + k 13 Problem 6. 79x has a 7 in its decimal expansion.1. then √ (2 + 5) p − 2 p+1 is divisible by p. . Find the exact numerical value of 1995 1 . 2x.32 Prove that Ç 1 (−1) 1994x + 1995x 0 1993 1994x åÇ 1994 1995x å dx = 0. ..1. .33 Prove that √ √ √ √ n+ n+1 = n+ n+2 . .1.1.28 Let k ≥ 2 be a natural number and x a positive real number. . . Prove that for any real number x = 0 at least one of x. Problem 6. the number of factors contributing a second factor of p is n/p2 .1. lim n→∞ k k 1≤k≤n 6.2 De Polignac’s Formula We will consider now the following result due to De Polignac.1.30 (AIME 1991) Suppose that r is a real number for which 91 k r+ = 546.26 Prove that the n-th number not of the form ek . Can you improve the “gap” between 34 and 79? 2 2 4 4 6 6 8 8 π · · · · · · · ··· = . Find a real number x = 0 such that Problem 6. Problem 6. when n is a natural number. 34x have no 7’s in their decimal expansions. 2. .1. 169 Theorem (De Polignac’s Formula) The highest power of a prime p dividing n! is given by ∞ k=1 n . k = 1.1.29 1.25 Prove that if p is an odd prime... Problem 6. .62 Problem 6. Chapter 6 Problem 6.

we see that the power of any prime dividing the numerator of n! n1 !n2 ! · · · nk ! is at least the power of the same prime dividing the denominator. By De Polignac’s Formula this is ∞ 300/5k = 60 + 12 + 2 = 74. prove that the least common multiple of the products x1 x2 · · · xk (k ≥ 1). Since there are more factors of 2 in 300! than factors of 5. 500 500 Ç å 1000 ? 500 172 Example Let n = n1 + n2 + · · · + nk where the ni are nonnegative integers. the number of zeroes is thus determined by the highest power of 5 in 300!. Solution: We claim that the least common multiple of the numbers in question is p p n/p . Since n1 /p j + n2/p j + · · · + nk /p j ≤ (n1 + n2 + · · · + nk )/p j . The power of p dividing n1 !n2 ! · · · nk ! is j≥1 n1 /p j + n2 /p j + · · · nk /p j . For any prime p. p prime . and so 7 does not divide . is less than n!. Prove that the quantity n! n1 !n2 ! · · · nk ! is an integer. Similarly.De Polignac’s Formula 63 Solution: The number of zeroes is determined by how many times 10 divides into 300. the power of p dividing n! is n/p j = j≥1 j≥1 (n1 + n2 + · · · + nk )/p j . 173 Example Given a positive integer n > 3. Since = (500!)2 500 Ç å Ç å 1000 1000 is 164 − 2 · 82 = 0. which establishes the assertion. the highest power of 7 that divides the highest power of 7 dividing into 500! is 71 + 10 + 1 = 82. k=1 171 Example Does 7 2 Solution: The highest power of 7 dividing into 1000! is 1000/7 + 1000/7å + 1000/73 = 142 + 20 + 2 = 164. whose factors xi are the positive integers with x1 + x2 + · · · xk ≤ n. Solution: From (3) in Theorem ?? we deduce by induction that a1 + a2 + · · · + al ≤ a1 + a2 + · · · + al . Ç 1000 1000! .

2.. Problem 6.2. we have n . is an integer.. the base-ten representation of m! ends with exactly n zeroes.1 (AHSME 1977) Find the largest possible n such that 10n divides 1005!.64 Chapter 6 Consider an arbitrary product x1 x2 · · · xk .2. .9 Prove that if m and n are relatively prime positive integers then (m + n − 1)! Problem 6. equals 1.2 Find the highest power of 17 that divides a “factorial tail” if there is some positive integer m such that (17n − 2)! for a positive integer n.5 (AIME 1983) What is the largest two-digit m!n! prime factor of the integer is an integer.2.. Two sequences Spec(α ) and Spec(β ) are said to be complementary if they partition the natural numbers. 2α . Clearly pα1 + · · · + pαk ≤ n and since pα ≥ α p. n. Practice Problem 6.3 Complementary Sequences Problem 6. (n. i. . n + 1) lcm . .. Using the result of part 1 or otherwise.7 Prove that if n > 1.e. Problem 6. . pα j +1 |x j .10 If p is a prime divisor of with p ≥ 2n n Ç å Problem 6.6 (USAMO 1975) 1. . How many positive integers less than 1992 are not factorial Problem 6. The assertion of the problem now follows upon applying De Polignac’s Formula and the claim.}. . k = n/p . .11 Prove that ÇÇ å Ç å Ç åå n n n lcm(1. we see that there is at least one product for which equality is achieved. This proves the claim. Suppose that pα j |x j .12 ProveåÇ å the following result of Catalan: Ç å Ç m+n 2m 2n divides . n m n We deﬁne the spectrum of a real number α to be the inﬁnite multiset of integers Spec(α ) = { α .2. But on choosing x1 = · · · = xk = p. p(α1 + · · · αk ) ≤ n or α1 + · · · + αk ≤ p Hence it follows that the exponent of an arbitrary prime p is at most n/p . = 1 n+1 2 n 6.2.4 Find the largest power of 7 in 300!. Problem 6.2. prove that (5m)!(5n)! m!n!(3m + n)!(3n + m)! is an integer for all positive integers m. Spec(α ) ∩ Spec(β ) = ∅ and Spec(α ) ∪ Spec(β ) = N. 3α . . 2.8 (AIME 1992) Deﬁne a positive integer n to be Problem 6.3 Find the exponent of the highest power of 24 tails? that divides 300!. . then (2n − 4)! n!(n − 2)! Problem 6. and an arbitrary prime p. Ç å 200 ? Ç å 100 √ 2n Problem 6.2.2. Prove that 2n prove that the exponent of p in the factorisation of n 5x + 5y ≥ 3x + y + 3y + x .2. .2. 2. 6) = 1.2. Problem 6.

12. u The converse of Beatty’s Theorem is also true.. α β Proof: If both α . By Beatty’s Theorem. it appears that the two sequences √ Spec( 2) = {1. u n 176 Example Suppose we sieve the positive integers as follows: we choose a1 = 1 and then delete a1 + 1 = 2. 27. as this is true for any N ≥ 1 each interval (n. Thereby we leave the integers 1. β > 1. 20. Solution: What we are asking for is a sequence {Sn } which is complementary to the sequence {S√+ n}. 22. n + 1) contains exactly one such term. 6. Practice . 9. 10. α β then the sequences are complementary. 21. it is clear that Spec(α ). 19. 24. whence α > 1 (and so β > 1 also). 14. n nτ and nτ + n = n(τ + 1) are complementary if 1/τ + 1/(τ + 1) = 1. β are positive irrational numbers with 1 1 + = 1. 174 Theorem (Beatty’s Theorem. 30. 1926) If α > 1 is irrational and 1 1 + = 1. But then τ = (1 + 5)/2. Proof: Since α > 1. If 0 < α ≤ 1. 3. then n/α + n/β = 1. hence n = [mα ]. which we call a2 . we deduce [N/α ]+ [N/β ] = N −1. 16. 44. 47. 1957) If the sequences Spec(α ) and Spec(β ) Spec(α ) and Spec(β ) are complementary. 17. 23. Thus the total number of terms not exceeding N in Spec(α ) and Spec(β ) is N − 1. 16. It follows that Spec(α ) ∪ Spec(β ) = N. β are rational numbers. But N/α − 1 + N/β − 1 < N/α + [N/β ] < N/α + N/β . 18. and then we delete a2 + 2 = 5. The next term is 3. 2. 17. given n there is an M for which mα − 1 < n ≤ mα . . 51. and we delete a3 + 3 = 7. 9. and the total number of terms not exceeding N taken together in both sequences is N/α + N/β . As 1/α + 1/β = 1. 11. The n-th term is thus an = nτ . we gather that N −2 < N/α + N/β < N. 34. . which implies that Spec(α ) = N. etc. Spec(β ) eventually contain the same integers. it follows that 1/α + 1/β = 1. and so are not disjoint. Spec(α ) and Spec(β ) are each sequences of distinct terms. Thus α and β must be irrational. Since the sandwiched quantity is an integer. Find a formula for an . 11. 12. . 40. . the Golden ratio. 175 Theorem (Bang’s Theorem. . 37.}. 8. 14.} 65 are complementary. 7. 8. 25. β are irrational. 4. 5. . 6. If Spec(α ) ∩ Spec(β ) is ﬁnite. 4. . . Thus the next available integer is 4 = a3 . 15.Practice For example. . the last inequality being strict because both α . lim n→∞ n 1 but since ( n/α + n/β ) → 1/α + 1/β as n → ∞. then α . Spec(α ) ∩ Spec(β ) = ∅. The following theorem establishes a criterion for spectra to be complementary. and √ Spec(2 + 2) = {3. 13.

ω (20) = 2. 11. If f (mn) = f (m) f (n) for every pair of natural numbers m. d2 ) = 1.66 √ 1+ 5 Ratio. σ (20) = 42. d2 of positive divisors of a and b. 9. Ω(20) = 3.3. ω (n) Ω(n) In symbols the above functions are: d(n) = d|n 1. ω (n) = p|n 1.1 (Skolem) Let τ = { τ τn 2 Chapter 6 Prove that the three sequences (n ≥ 1) }. every divisor d of ab has the form d = d1 d2 where d1 |a. we say that f is then a multiplicative function. 6. This completes the proof. the number of primes dividing n. n we say then that f is totally multiplicative. we have d(20) = 6. Then F is also multiplicative. 5. since 1. then there is a positive integer a such that f (a) = 0. 2. Then r 1 2 f (n) = f (pa1 ) f (pa2 ) · · · f (par ). the sum of the positive divisors of n. if n = ab. counting multiplicity. For this we need ﬁrst the following result.4 Arithmetic Functions An arithmetic function f is a function whose domain is the set of positive integers and whose range is a subset of the complex numbers. u . 4. n. 3. Let f be multiplicative and let n have the prime factorisation n = pa1 pa2 · · · par . (a. Hence.n)=1 (The symbol || in p ||n is read exactly divides and it signiﬁes that pα |n but pα +1 |n. 10 and 20 are the divisors of 20. α 177 Theorem Let f be a multiplicative function and let F(n) = d|n f (d). (k. Thus there is a one-to-one correspondence between positive divisors d of ab and pairs d1 . Hence f (a) = f (1 · a) = f (1) f (a) which entails that f (1) = 1. the number of positive integers not exceeding n and relative prime to n. 17. If f is an arithmetic function which is not identically 0 such that f (mn) = f (m) f (n) for every pair of relatively prime natural numbers m. By the Fundamental Theorem of Arithmetic. σ (n) = d|n d. 7. 19 are the positive integers not exceeding 20 and relatively prime to 20. We will now show that the functions d and σ are multiplicative. r 1 2 A multiplicative function is thus determined by its values at prime powers. b) = 1 then F(n) = d|n f (d) = d1 |a d2 |b f (d1 d2 ). the number of distinct prime divisors of n. (d1 . 13. { τ τ 2 n }. we see that φ (20) = 8. Since f is multiplicative the dextral side of the above equals f (d1 ) f (d2 ) = d1 |a d2 |b d1 |a f (d1 ) d2 |b f (d2 ) = F(a)F(b). { τ 2 n } are complementary. Proof: Suppose that a. Ω(n) = pα ||n α. b) = 1. and φ (n) = 1≤k≤n 1. b are natural numbers with (a. Since the numbers 1. be the Golden Problem 6. If f is multiplicative.) For example. The following functions are of considerable importance in Number Theory: d(n) σ (n) φ (n) the number of positive divisors of the number n. d2 |b.

181 Example Prove that n n d(k) = k=1 j=1 n j Solution: We have n n d(k) = k=1 k=1 j|k 1. 1 ≤ k ≤ n. Hence. pa and so d|n d(pa ) = a + 1. Tn whereby with the operation Tk . For example. the divisors of pa are 1. This gives at most 2 n divisors. will be unlocked after n operations if and only if m has an odd number of divisors. p3 . Interchanging the order of summation 1= j≤n k≡0 j≤k≤n j≤n n . Solution: Since 6 can be factored as 2 · 3 and 6 · 1. d(2904) = d(23 · 3 · 112) = d(23 )d(3)d(112 ) = (1 + 3)(1 + 1)(1 + 2) = 24. T2 . p2 . where p. √ n n Solution: Each positive divisor a of n can paired with its complementary divisor . . . . After all the n operations have been performed it is observed that all lockers whose numbers are perfect squares (and only those lockers) are now open or unlocked. Solution: Observe that locker m. 1 ≤ m ≤ n. 178 Example (AHSME 1993) For how many values of n will an n-sided polygon have interior angles with integral degree measures? (n − 2)180 Solution: The measure of an interior angle of a regular n-sided polygon is . then r 1 2 d(n) = (1 + a1)(1 + a2) · · · (1 + ar ). . 1 + β = 3 or 1 + α = 6. We give now some examples pertaining to the divisor function. the condition of being locked or unlocked is changed for all those lockers and only those lockers whose numbers are multiples of k. the desired n must have only two distinct prime factors. 180 Example Find all positive integers n such that d(n) = 6. the theorem above shows that d(n) = 1 is a multiplicative function. n must be of one of the forms pq2 or p5 . This entails that if n has the prime factorisation n = pa1 pa2 · · · par . p and q. An attendant performs a sequence of operations T1 . Prove this mathematically. q are distinct primes. .Arithmetic Functions 67 Since the function f (n) = 1 for all natural numbers n is clearly multiplicative (indeed. 2. . It follows that n must divide 180. The assertion is proved. As n = a · . 1 + β = 1. . one of these divisors must be a a √ √ ≤ n. the answer is 16. 179 Example Prove that d(n) ≤ 2 n. If p is a prime. . . j mod j which is what we wanted to prove. . p. Now. say. totally multiplicative). . n and are originally locked. . Thus n = pα qβ and either 1 + α = 2. Since n there are 18 divisors of 180. . 182 Example (Putnam 1967) A certain locker room contains n lockers numbered 1. d(m) is odd if and only if m is a perfect square. because n ≥ 3 and so we must exclude the divisors 1 and 2.

and so b|m. n/d ≡ 7 mod 8 or vice versa. Solution: Let s ≥ n. 10) = 1. Also. totally multiplicative). d|n We say that a natural number is perfect if it is the sum of its proper divisors. whence 24 divides d + n/d. and so σ (m) = 2s+1 b for some natural number b. Conversely. Since (2 p−1 . Practice . no divisor is used twice in the pairing. then there are at least three divisors of m. Then σ (x2 ) = σ (y2 ) = 31σ (s2 ). The following theorem is classical. (s. If p is a prime. But then (2s+1 − 1)b = m. p1 − 1 p2 − 1 pr − 1 We present now some examples related to the function σ . It is easy to see that a natural number is perfect if and only if 2n = d|n d. We propose to show that b = 1. Prove that the sum of all divisors of n is also divisible by 24. For example. This means that 2s+1 − 1 is a Mersenne prime and hence s + 1 must be a prime. which yields σ (m) ≥ 1 + b + m. In all cases d + n/d ≡ 0 mod 3 and mod 8. This entails that if n has the prime factorisation n = pa1 pa2 · · · par . 2 w r r 1 This last product also equals a a p11 +1 − 1 p22 +1 − 1 par +1 − 1 · ··· r . Observe that b + m = (2s+1 − 1)b + b = 2s+1 b = σ (m). then clearly σ (pa ) = 1 + p + p2 + · · ·+ pa . σ (n) = 2n = 2s+1 m. d ≡ 3. a contradiction. n/d ≡ 2 mod 3 or vice versa. σ (2 p−1(2 p − 1)) = σ (2 p−1 )σ (2 p − 1) = (1 + 2 + 22 + · · · + 2 p−1)(1 + 2 p − 1) = (2 p − 1)2(2 p−1). n ≡ 1 or 2 mod 3 and d ≡ 1. 184 Theorem An even number is perfect if and only if it is of the form 2 p−1 (2 p − 1) where both p and 2 p − 1 are primes. 6 is perfect because 6 = d|6. m odd. and 2 p−1 (2 p − 1) is perfect. the only possibilities d are d ≡ 1. We take x = 5s. r 1 2 then 2 σ (n) = (1 + p1 + p1 + · · · + pa1 )(1 + p2 + p2 + · · · + pa2 ) · · · (1 + pr + p2 + · · · + par ). One deduces that 2s+1 |σ (m).68 Chapter 6 Since the function f (n) = n is multiplicative (indeed.d=6 d= 1 + 2 + 3. d ≡ 1. since n perfect is. 2 p − 1) = 1. Proof: Suppose that p. 183 Example (Putnam 1969) Let n be a positive integer such that 24|n + 1. As d( ) ≡ −1 mod 3 or mod 8. namely 1. As d ≡ n/d. Thus b = 1. b = m. Then σ (n) = σ (2s )σ (m) = (2s+1 − 1)σ (m). b and m. 3.u 185 Example Prove that for every natural number n there exist natural numbers x and y such that x − y ≥ n and σ (x2 ) = σ (y2 ). n/d ≡ 5 mod 8 or vice versa. and so m = (2s+1 − 1)b = 2s+1 − 1 is a prime. 2 p − 1 are primes. If b = 1. the above theorem entails that σ is multiplicative. 5 or 7 mod 8. This implies that 24| d. y = 4s. let n be an even perfect number. Then σ (2 p − 1) = 1 + 2 p − 1. n Solution: Since 24|n + 1. Hence (2s+1 − 1)σ (m) = 2s+1 m. Write n = 2s m.

4..23 Find the number of sets of positive integers vide n? {a. ω (1024).14 Characterise all n for which σ (n) is odd. n + n. dk (n) = d(dk−1 (n)).4.5 Euler’s Function. Problem 6. Problem 6.4.9 Prove that d=n d|n d(n)/2 . 31 19 n n Problem 6. k > 1 a ﬁxed natural d(n) = 10. Problem 6.19 Show that an odd perfect number must contain one prime factor p such that.1 Find the numerical values of d(1024).4. Problem 6.11 (AIME. How many positive integer divisors of n2 are less than n but do not di.13 Prove that σ (n) = n + k.4.18 Prove that in an odd perfect number. .4.Euler’s Function.4.4. k = 2.Problem 6. σ (k) = k=1 j=1 j n . j Problem 6. .15 Prove that p is a prime if and only if σ (p) = √ 1 + p. .7 Let m ∈ N be given. 1 − tn Problem 6. Reduced Residues Recall that Euler’s φ (n) function counts the number of positive integers a ≤ n that are relatively prime to n.4. Reduced Residues 69 Problem 6. Problem 6. . b. only one of its prime factors occurs to an odd power.4. 3. holds: n! 2 n ∞ ∞ tn d(n)t n = .3 Prove that d(2n − 1) ≥ d(n). We will prove now that φ is multiplicative. Problem 6. First we need the following deﬁnitions.12 Prove that if n is composite. Problem 6.17 Prove that an odd perfect number must have n=1 n=1 at least two distinct prime factors. d|n Problem 6.4.4.4 Prove that d(n) ≤ 3n with equality if and only if n = 12.2 Describe all natural numbers n such that Problem 6.4. c} such that a × b × c = 462. Prove that the set A = {n ∈ N : m|d(n)} contains an inﬁnite arithmetic progression. Show that 1 = 2. Describe dk (n) for sufﬁciently large k. both p and a are congruent to 1 modulo 4. Problem 6.16 Prove that 1 1 σ (n!) Problem 6.21 Prove that there do not exist odd perfect numbers having exactly three distinct prime factors.4. 6. all other prime factors must occur to an even power. then σ (n) > Problem √ Ω(1024) and φ (1024). number has only ﬁnitely many solutions. d Problem 6.4.5 Prove that the following Lambert expansion ≥ 1 + + ··· + . σ (1024). if the highest power of p occurring in n is pa . 6. Problem 6.4.4.6 Let d1 (n) = d(n). all the others occur to an even power.22 Prove that Problem 6.4.4. 1995) Let n = 2 3 .4. Problem 6.20 Prove that every odd perfect number having three distinct prime factors must have two of its prime factors 3 and 5.8 Let n be a perfect number.4.4. Problem 6. Problem 6.10 Prove that the power of a prime cannot be a perfect number. This requires more work than that done for d and σ .4.

7.. b) = 1. . For if ia + k ≡ ja + k mod b then a(i − j) ≡ 0 mod b. We must determine how many of these integers are relatively prime to b. . . For example. in some order. 2p. . 188 Theorem The function φ is multiplicative.... j ∈ [0. congruent to the integers 0. n > 1 is a set of φ (n) incongruent integers modulo n that are relatively prime to n. . We shall determine ﬁrst the number of integers in the above array that are relatively prime to a and ﬁnd out how may of them are also relatively prime to b.. 5.. . . (b − 1)a + 1 (b − 1)a + 2 (b − 1)a + 3 . . 2/n.. 1. The φ (n) integers 1 = a1 < a2 < · · · < aφ (n) = n − 1 less than n and relatively prime to n are called the canonical reduced residues modulo n.. But exactly φ (b) of these are relatively prime to b. a+k . (n − 1)/n. 5.. 11 and the set {−11. . This means that the b integers in any of these φ (n) columns are. a 2a 3a . . k will have a common factor with a if and only if ma + k does. 2. (b − 1)a + k . This forces i = j. 0 ≤ m ≤ b − 1. ba Now. then 1 a φ (n) = (pa1 − p11 −1 ) · · · (pk k − pk k 1 a a −1 ). 23} forms a reduced residue system modulo 12. 1 2 3 a+1 a+2 a+3 2a + 1 2a + 2 2a + 3 .. 1 ≤ k ≤ a. if a n = pa1 · · · pk k is the factorisation of n into distinct primes.. . . This means that exactly φ (a)φ (b) integers on the array are relatively prime to ab.. b − 1. . . the canonical reduced residues mod 12 are 1. . . .. an integer r is relatively prime to m if and only if it is relatively prime to a and b... ab as follows. There are φ (a) integers relatively prime to a in the ﬁrst row. .... . . How many of the fractions 1/n.. . . Thus φ (pm ) = pm − pm−1 . we deduce that i − j ≡ 0 mod b thanks to Corollary ??. n/n are irreducible? n Solution: This number is clearly k=1 φ (k). 3p. ..70 Chapter 6 186 Deﬁnition Let n > 1. . b − 1] which implies that |i − j| < b. (a.. Now i.. Since (a. .. and φ (550) = φ (2 · 52 · 11) = φ (2) · φ (52 ) · φ (11) = (2 − 1)(52 − 5)(11 − 1) = 1 · 20 · 10 = 200. pm−1 p are the only positive integers ≤ pm sharing any prime factors with pm . . Now consider the k-th column. .. We arrange the ab integers 1. the integers p. .. Proof: Let n be a natural number with n = ab. k . Each integer on this column is of the form ma + k. a + k.... We claim that no two integers k. which is what we wanted to show. We are now ready to prove the main result of this section. . φ (48) = φ (24 · 3) = φ (24 )φ (3) = (24 − 23 )(3 − 1) = 16. This means that there are exactly φ (a) columns of integers that are relatively prime to a. As k ≡ ma + k mod a. (b − 1)a + k on the k-th column are congruent modulo b.. 189 Example Let n be a natural number. 187 Deﬁnition A reduced residue system modulo n. 2a + k .. b) = 1. Since φ is multiplicative. For example.u If p is a prime and m a natural number. 19.

) = 1. 191 Theorem Let n be a positive integer.n)=1 (a. If k ∈ Td (n). let Td (n) be the set of positive integers ≤ n whose gcd with n is d. d d d d n Therefore counting the elements of Td (n) is the same as counting the integers a with 1 ≤ a ≤ n/d. Solution: Observe that p > 4 must be a multiple of 6. We gather that n= d|n φ (n/d). (m. Thus S= 1≤a≤n a= 1≤a≤n n − a. (a. 2 (a. Note that the elements of Td (n) are found amongst the integers n k n n d. (a. so p = 2a 3b m. ) = 1. . . φ (n/d) = d|n But as d runs through the divisors of n. n) = 1. and p > 4. Reduced Residues 190 Example Prove that for n > 1. . then k = ad.n)=1 Solution: Clearly if 1 ≤ a ≤ n and (a. n) = 1. d. 6) = 1.u d|n 192 Example If p − 1 and p + 1 are twin primes. This implies that (a. 71 a= 1≤a≤n nφ (n) . prove that 3φ (p) ≤ p. ab ≥ 1. Then d|n φ (d) = n. 2d. .Euler’s Function. But d there are exactly φ (n/d) such a. But then ( . We then have φ (p) ≤ 2a 3b−1 φ (m) ≤ 2a 3b−1 m = p/3. the Td partition the set {1. . . 1 ≤ n − a ≤ n and (n − a. . Prove that the equation φ (x) = n! is soluble.n)=1 The assertion follows. n} and so Td (n) = n.n)=1 whence 2S = 1≤a≤n n = nφ (n). As d varies over the divisors of n. (a. whence n = φ (d). Proof: For each divisor d of n. ) = 1. 1 ≤ a ≤ n/d and (k. 193 Example Let n ∈ N. 2. n/d runs through the divisors of n in reverse order. . d|n We claim that Td (n) has φ (n/d) elements. n) = d.

Then x = pα ||n pα . then tag another.5. Show that ∀ k ∈ N. p ã Problem 6. skip k. The integer x will have the same prime factors as n provided that p−1 (p − 1)|n.9 Prove that if φ (n)|n − 1 and n is composite. It follows that x = n2 /φ (n). It is p|n clear then that a necessary and sufﬁcient condition for φ (x) = n to be soluble under the restriction that x has precisely the same prime factors as n is (p − 1)|n. In general we can show that φk (n) > 2 2 4 4 1 2−k−1 k+2 n .4 Prove that φ (n) ≥ n2−ω (n). 4 φ (n) = 195 Example Find inﬁnitely many integers n such that 10|φ (n).5. φ (n) = n p|n 1− Problem 6. φk (n) > 1 for all sufﬁciently large n. Answer: 400 Problem 6. and so on.5. For how many positive values of k less than 400 will every person in the circle get tagged at least once? Problem 6. 194 Example Let φk (n) = φ (φk−1 (n)). This restriction implies that φ (x)/x = φ (n)/n. then n must be squarefree.5. . Clearly r 1 2 p 11 p 22 · · · p r r Hence a /2 a /2 a /2 > 2r−1 ≥ pr 1 p1 ··· . Problem 6.1 Prove that Å 1 . then n has at least four prime factors. where φ0 (n) = φ (n). Problem 6. . .5. .72 Chapter 6 Solution: We want to solve the equation φ (x) = n with the constraint that x has precisely the same prime factors as n. Problem 6. Therefore φ1 (n) > φ (n) > n = n1/4 . then n must be of the form 2a 3b for nonnegative integers a.. k = 1. When is equality achieved? Problem 6. .5. 2. Solution: Take n = 11k .5 Prove that φ (n) > √ n for n > 6.8 (Mandelbrot 1994) Four hundred people are standing in a circle. . If n = k!. b.10 Prove that if φ (n)|n − 1 and n is composite. p 1 p 2 · · · p ar ≥ ··· r p1 p2 pr 2 pa1 /2 pa2 /2 · · · par /2 r 1 2 … » √ √ 1 1 1 1 This last quantity equals n/2. k = 1. . this last condition is clearly satisﬁed. 2. Let n = pα ||n pα . 2 p1 − 1 pr − 1 a a 1 p 11 p 22 · · · p ar p r − 1 a1 a2 p1 − 1 p2 − 1 r . . Then φ (11k ) = 11k − 11k−1 = 10 · 11k−1. You tag one person. We conclude that n ≥ 22 implies that φk (n) > 1. An explicit solution to the problem is thus p|n x = (k!)2 /φ (k!). Solution: Let pa1 pa2 · · · par be the prime factorisation of n.5. Practice Problem 6.5. then skip k people.2 Prove that if n is composite then φ (n) ≤ n − √ n.6 If φ (n)|n. continuing until you tag someone for the second time. Problem 6.5.5.3 (AIME 1992) Find the sum of all positive rational numbers that are less than 10 and have denominator 30 when written in lowest terms.7 Prove that if φ (n)|n − 1. then n has at least three distinct prime factors.

n) = 1. Proof: Assume that b is the inverse of a mod n. a has an inverse mod n. Another look at the table shows the interesting product 3 ·6 2 = 0. by the Bachet-Bezout Theorem there are integers x.5. Problem 6. 3. 197 Theorem Let n > 1.. σ (n) + φ (n) = nd(n). As an example. which entails the existence of an integer s such that ab − 1 = sn.6 Multiplication in Zn In section 3. To obtain 4 ·6 2 we ﬁrst multiplied 4 · 2 = 8 and then reduced mod 6 obtaining 8 ≡ 2 mod 6. Then a possesses an inverse modulo n if and only if a is relatively prime to n. we see that 0. For example.5. It is easy to see that inverses are unique mod n. y such that ax + ny = 1. Why is it interesting? We have multiplied to non-zero entities and obtained a zero entity! Does Z6 form a group under ·6 ? What is the multiplicative identity? In analogy with the rational numbers. By inspection we see that this is x ≡ 3 mod 7.5 we saw that Zn endowed with the operation of addition +n becomes a group.12 Prove that a necessary and sufﬁcient condition for n to be a prime is that max ak+1 − ak to be the maximum gap between the ak . This is a linear combination of a and n and hence divisible by (a. i. We would then deﬁne the multiplicative inverse of a to be that b that has the property that a ·6 b = b ·6 a = 1. n) = 1. Conversely if (a.11 For n > 1 let 1 = a1 < a2 < · · · < aφ (n) = n − 1 be the positive integers less than n that are relatively prime to n. . Prove that ω (n) ≤ g(n). (ya)x ≡ y mod n. Solution: We are looking for a solution to the congruence 5x ≡ 1 mod 7. How to deﬁne multiplication in Zn ? If we want to multiply a ·n b we simply multiply a · b and reduce the result mod n. The answer is thus 4 ·6 2 = 2. For that we need the following. We need to be able to identify the invertible elements of Zn . let us consider Table ??. y are inverses to a mod n then ax ≡ 1 mod n and ay ≡ 1 mod n. a be integers.u 198 Example Find the inverse of 5 mod 7. ·6 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 1 2 3 4 5 2 0 2 4 0 2 4 3 0 3 0 3 0 3 4 0 4 2 0 4 2 5 0 5 4 3 2 1 Table 6. Deﬁne the Jacobsthal function g(n) := 1≤k≤φ (n)−1 73 (Hint: Use the Chinese Remainder Theorem). But then. Then ab ≡ 1 mod n. we encounter some problems. 2. we would like 1 to be the multiplicative identity. This immediately yields ax ≡ 1 mod n. An integer b is said to be the inverse of an integer a modulo n if ab ≡ 1 mod n. 6. and 4 do not have a multiplicative inverse. Multiplying by y the ﬁrst of these congruences. ab − sn = 1. n).e. This implies that (a.1: Multiplication Table for Z6 196 Deﬁnition Let n > 1 be a natural number. We are now going to investigate the multiplicative structure of Zn .Multiplication in Zn Problem 6. i.e. For if x. Hence x ≡ y mod n.

n since it inherits associativity from the integers. By the Well-Ordering Principle. u The following theorem is of utmost importance. a2 .t with 1 ≤ s < t ≤ n + 1 such that as ≡ at mod n. Proof: Assume that ordn a|t. n We now give some assorted examples. because then am ≡ 0 mod n for all positive integers m. not all integers a are going to have an order mod n. there is an integer s with am + sn = 1 or a · am−1 + sn = 1. i.e.. .74 Chapter 6 According to the preceding theorem. Hence assume that a has an order mod n. . That is. aφ (n) }. It is easy to see that the operation ·n is associative. Hence y = 0 and thus t = x · ordn a. This entails that (a. Consider the sequence a. This gives at ≡ asordn a ≡ (aordn a )s ≡ 1s ≡ 1 mod n. Hence as ≡ at mod n gives at−s as ≡ at−s at mod n. . Then ay ≡ at−xordn a ≡ at · (aordn a )−x ≡ 1 · 1−x ≡ 1 mod n. and so the order of 3 mod 7 is 6. Hence. Now. we say that a has order m mod n. The existence of an order entails the existence of a positive integer m such that am ≡ 1 mod n. The question as to which integers are going to have an order mod n is answered in the following theorem. . etc. we can ﬁnd s. which proves the result. 0 ≤ y < ordn a. which is to say at ≡ at−s at mod n. Given n. 203 Theorem Let (a. the preceding theorem tells us that there is a positive integer k with ak ≡ 1 mod n. 201 Deﬁnition If m is the least positive integer with the property that am ≡ 1 mod n.u . Solution: Observe that 21 ≡ 2. 202 Theorem Let n > 1 be a positive integer. 4. The pattern 2. n) = 1 and let t be an integer. . Using Corollary ?? we gather that at−s ≡ 1 mod n. 22 ≡ 4. This says that there is no power of 2 which is ≡ −1 ≡ 6 mod 7. an+1 mod n. As there are n + 1 numbers and only n residues mod n. 199 Example (IMO 1964) Prove that there is no positive integer n for which 2n + 1 is divisible by 7. Proof: If (a. . 25 ≡ 4 mod 7. 36 ≡ 1 mod 7. We write this fact as ord7 3 = 6. n) = 1. This prompts the following deﬁnition. Clearly a = 0. ordn a|t. Proof: Since (a. n). Then a ∈ Z has an order mod n if and only if (a. 34 ≡ 4. a3 . n) = 1. Then at ≡ 1 mod n if and only if ordn a|t. 33 ≡ 6. 31 ≡ 3. 32 ≡ 2. This is clear if n|a. n) = 1. This contradicts the deﬁnition of ordn a as the smallest positive integer with that property. then a has an order in view of Theorem ?? and the Well-Ordering Principle. there exists a positive integer k ≤ n such that ak ≡ 1 mod n.u If (a. We let Z× = {a1 . . assume that at ≡ 1 mod n and t = x · ordn a + y. 1. n) = 1. n) = 1. We conclude that Z× is a group under the operation ·n . n) = 1 we must have (a j . 200 Theorem If a is relatively prime to the positive integer n. . n) = 1 for all j ≥ 1. there must be a smallest positive integer with this property. 26 ≡ 1 mod 7. a will have a multiplicative inverse if and only if (a. 35 ≡ 5. the Pigeonhole Principle two of these powers must have the same remainder mod n. If y > 0 we would have a positive integer smaller than ordn a with the property ay ≡ 1 mod n. 24 ≡ 2 mod 7. We thus see that only the reduced residues mod n have an inverse. 23 ≡ 1 mod 7. a2 . repeats thus cyclically. Conversely. This is a linear combination of a and n and hence divisible by (a. 1 ≤ t − s ≤ n. Then there is an integer s such that sordn a = t. For example.

. . Thus for example µ (6) = 1. . n) = 1.7 Möbius Function 1 µ (n) = (−1)ω (n) 0 if n = 1. 35. arφ (n) is also a reduced set of residues modulo n. 7. . Suppose that ari ≡ ar j mod n for some i = j. . . 208 Theorem The Möbius Function µ is multiplicative. 11 are the 5. 6. a. Practice Problem 6. as 1. then ar1 + b. 5) = 1. 5. Proof: We just need to show that the φ (n) numbers ar1 . . 6. b ∈ Z. If r1 . arφ (n) + b is also a reduced set of residues modulo n. r2 . The following result will be used repeatedly. 7. we deduce from Corollary ?? that ri ≡ r j mod n. Again. . Thus n = 3. (a. n is not square-free then µ (m)µ (n) = 0 = µ (mn). 11 is a reduced residue system modulo 12 and (12. and 0 for non-square free integers. . u 209 Theorem µ (d) = d|n ß 1 if n = 1. −1 for square free integers with an odd number of prime factors. This contradicts the fact that the r’s are incongruent. The following corollary to Theorem ?? should be immediate. 205 Theorem Let n > 1. .6. If r1 .1 Find the order of 5 modulo 12. 0 if n > 1. r2 . (a. 75 Solution: Observe that the order of 2 mod 7 is 3. ar2 . 25. This proves the theorem. Proof: Assume (m. µ (30) = −1 and µ (18) = 0. . n) = 1.u For example. so the theorem follows. . . 9. . ar2 + b. . arφ (n) are mutually incongruent mod n. the set 5. . rφ (n) is a reduced set of residues modulo n. Since (a. 55 is also a reduced residue system modulo 12. . . . 25.. then ar1 . 12. ar2 . rφ (n) is a reduced set of residues modulo n. 207 Deﬁnition The Möbius function is deﬁned for positive integer n as follows: Thus µ is 1 for n = 1 and square free integers with an even number of prime factors. . n) = 1. 206 Corollary Let n > 1. .Practice 204 Example (IMO 1964) Find all positive integers n for which 2n − 1 is divisible by 7. If one of m. n) = 1. if ω (n) = Ω(n). It must then be the case that 3|n. 5. 55 in some order and 1 · 5 · 7 · 11 ≡ 5 · 25 · 35 · 55 mod 12. the 1. If both M and n are square-free then µ (m)µ (n) = (−1)ω (m) (−1)ω (n) = (−1)ω (m)+ω (n) = µ (mn). if ω (n) < Ω(n). a ∈ Z. . . . We want 2n ≡ 1 mod 7. 35.

2 If f is an arithmetical function and F(n) = φ (n) = n d|n µ (d) . Proof: We have f (d) d|n = d|n s|d µ (s)F(d/s) µ (d/s)F(s) d|n s|d = = s|n µ (r)F(s).u 210 Theorem (Möbius Inversion Formula) Let f be an arithmetical function and F(n) = d|n f (d). the inner sum will be 0 unless s = n. k d|n k=0 By the Binomial Theorem this last sum is (1 − 1)ω (n) = 0. Hence only the term s = n in the outer s sum survives. Then f (n) = d|n µ (d)F(n/d) = d|n µ (n/d)F(d).7. d . Then F(n) = d|n f (d).u = s|n We now show the converse to Theorem ??. F be arithmetic functions with f (n) = d|n µ (d)F(n/d) for all natural numbers n.u Practice Problem 6. µ (d) = (−1)k . which means that the above sums simplify to f (n). in which case the entire sum reduces to F(n). n d| s n In view of theorem ??.7. 211 Theorem Let f .76 Ç Chapter 6 å ω (n) square-free divisors d of n with exactly k prime factors. the inner sum is different from 0 only when = 1. Proof: We have d|n µ (d)F(n/d) = d|n d|n = ds|n f (s) n s| d µ (d) f (s) f (s) µ (d). Proof: There are k The sum in question is thus å ω (n) Ç ω (n) µ (d) = (−1)k .1 Prove that Problem 6. For all such d. n r| s Using Theorem ??.

6 Given any positive integer k.3 If F is an arithmetical function such that Problem 6.Practice n 77 Problem 6. then k=1 |µ (d)| = 2ω (n) . Problem 6. prove that there n n exist inﬁnitely many integers n with µ (k)F([n/k]).7. prove that F(n) = f ( j).7.5 Prove that d|n µ (d)d(d) = (−1)ω (n) .7. k=1 . f (n) = j=1 µ (n + 1) = µ (n + 2) = · · · = µ (n + k).4 Prove that d|n n f ([n/k]). Problem 6.7. f (n) = j=1 µ ( j)F([n/ j]).

Chapter

7

a p−1 ≡ 1 mod p. mod p in view of

More on Congruences

7.1 Theorems of Fermat and Wilson

212 Theorem (Fermat’s Little Theorem) Let p be a prime and let p |a. Then

Proof: Since (a, p) = 1, the set a · 1, a · 2, . . . , a · (p − 1) is also a reduced set of residues Theorem ??. Hence (a · 1)(a · 2) · · ·(a · (p − 1)) ≡ 1 · 2 · · ·(p − 1) mod p, or a p−1(p − 1)! ≡ (p − 1)! mod p.

As ((p − 1)!, p) = 1 we may cancel out the (p − 1)!’s in view of Corollary ??. This proves the theorem.u As an obvious corollary, we obtain the following.

213 Corollary For every prime p and for every integer a,

ap ≡ a

mod p.

Proof: Either p|a or p |a. If p|a, a ≡ 0 ≡ a p mod p and there is nothing to prove. If p |a, Fermat’s Little Theorem yields p|a p−1 − 1. Hence p|a(a p−1 − 1) = a p − a, which again gives the result.u The following corollary will also be useful.

214 Corollary Let p be a prime and a an integer. Assume that p |a. Then ord p a|p − 1.

**Proof: This follows immediately from Theorem ?? and Fermat’s Little Theorem.u
**

215 Example Find the order of 8 mod 11.

**Solution: By Corollary ?? ord11 8 is either 1, 2, 5 or 10. Now 82 ≡ −2 mod 11, 84 ≡ 4 mod 11 and 85 ≡ −1 mod 11. The order is thus ord11 8 = 10.
**

216 Example Let a1 = 4, an = 4an−1 , n > 1. Find the remainder when a100 is divided by 7.

78

Theorems of Fermat and Wilson

79

Solution: By Fermat’s Little Theorem, 46 ≡ 1 mod 7. Now, 4n ≡ 4 mod 6 for all positive integers n, i.e., 4n = 4 + 6t for some integer t. Thus a100 ≡ 4a99 ≡ 44+6t ≡ 44 · (46 )t ≡ 4 mod 7.

217 Example Prove that for m, n ∈ Z, mn(m60 − n60) is always divisible by 56786730.

Solution: Let a = 56786730 = 2 · 3 · 5 · 7 · 11 · 13 · 31 · 61. Let Q(x, y) = xy(x60 − y60 ). Observe that (x − y)|Q(x, y), (x2 − y2 )|Q(x, y), (x3 − y3 )|Q(x, y), (x4 − y4 )|Q(x, y), (x6 − y6 )|Q(x, y), (x10 − y10 )|Q(x, y), (x12 − y12 )|Q(x, y), and (x30 − y30 )|Q(x, y). If p is any one of the primes dividing a, the Corollary to Fermat’s Little Theorem yields m p − m ≡ 0 mod p and n p − n ≡ 0 mod p. Thus n(m p − m) − m(n p − n) ≡ 0 mod p, i.e., mn(m p−1 − n p−1) ≡ 0 mod p. Hence, we have 2|mn(m − n)|Q(m, n), 3|mn(m2 −n2 )|Q(m, n), 5|mn(m4 −n4 )|Q(m, n), 7|mn(m6 −n6 )|Q(m, n), 11|mn(m10 −n10 )|Q(m, n), 13|mn(m12 −n12 )|Q(m, n), 31|m n30 )|Q(m, n) and 61|mn(m60 − n60 )|Q(m, n). Since these are all distinct primes, we gather that a|mnQ(m, n), which is what we wanted.

218 Example (Putnam 1972) Show that given an odd prime p, there are always inﬁnitely many integers n for which p|n2n + 1.

**Answer: For any odd prime p, take n = (p − 1)2k+1, k = 0, 1, 2, . . .. Then n2n + 1 ≡ (p − 1)2k+1 (2 p−1 )(p−1) + 1 ≡ (−1)2k+1 12k + 1 ≡ 0
**

2k

mod p.

219 Example Prove that there are no integers n > 1 with n|2n − 1.

Solution: If n|2n − 1 for some n > 1, then n must be odd and have a smallest odd prime p as a divisor. By Fermat’s Little Theorem, 2 p−1 ≡ 1 mod p. By Corollary ?? , ord p2 has a prime factor in common with p − 1. Now, p|n|2n − 1 and so 2n ≡ 1 mod p. Again, by Corollary ??, ord p 2 must have a common prime factor with n (clearly ord p2 > 1). This means that n has a smaller prime factor than p, a contradiction.

220 Example Let p be a prime. Prove that

1.

2.

Ç

å p−1 ≡ (−1)n n Ç å p+1 ≡0 n

mod p, 1 ≤ n ≤ p − 1.

mod p, 2 ≤ n ≤ p − 1.

3. If p = 5 is an odd prime, prove that either f p−1 or f p+1 is divisible by p. Solution: (1) (p − 1)(p − 2) · · ·(p − n) ≡ (−1)(−2) · · · (−n) ≡ (−1)n n! mod p. The assertion follows from this. (2) (p + 1)(p)(p − 1) · · ·(p − n + 2) ≡ (1)(0)(−1) · · · (−n + 2) ≡ 0 mod p. The assertion follows from this. (3) Using the Binomial Theorem and Binet’s Formula ÇÇ å Ç å Ç å å n n 1 n +5 fn = n−1 + 52 + ··· . 1 2 3 5 From this and (1), 2 p−2 f p−1 ≡ p − 1 − (5 + 52 + · · · + 5(p−3)/2) ≡ − 5(p−1)/2 − 1 4 mod p.

80 Using (2), Thus But by Fermat’s Little Theorem, 5 2 p f p+1 ≡ p + 1 + 5(p−1)/2 ≡ 5(p−1)/2 + 1 2 p f p−1 f p+1 ≡ 5 p−1 − 1 mod p. mod p.

Chapter 7

p−1

≡ 1 mod p for p = 5. The assertion follows.

221 Lemma If a2 ≡ 1 mod p, then either a ≡ 1 mod p or a ≡ −1 mod p.

Proof: We have p|a2 − 1 = (a − 1)(a + 1). Since p is a prime, it must divide at least one of the factors. This proves the lemma.u

222 Theorem (Wilson’s Theorem) If p is a prime, then (p − 1)! ≡ −1 mod p.

In other words,

Proof: If p = 2 or p = 3, the result follows by direct veriﬁcation. So assume that p > 3. Consider a, 2 ≤ a ≤ p − 2. To each such a we associate its unique inverse a mod p, i.e. aa ≡ 1 mod p. Observe that a = a since then we would have a2 ≡ 1 mod p which violates the preceding lemma as a = 1, a = p − 1. Thus in multiplying all a in the range 2 ≤ a ≤ p − 2, we pair them of with their inverses, and the net contribution of this product is therefore 1. In symbols, 2 · 3 · · ·(p − 2) ≡ 1 mod p. (p − 1)! ≡ 1 · Ñ j é · (p − 1) ≡ 1 · 1 · (p − 1) ≡ −1 mod p.

2≤a≤p−2

This gives the result. u

223 Example If p ≡ 1 mod 4, prove that

As (−1)(p−1)/2 = 1, we obtain the result.

**Solution: In the product (p − 1)! we pair off j, 1 ≤ j ≤ (p − 1)/2 with p − j. Observe that j(p − j) ≡ − j2 mod p. Hence Å ã p−1 −1 ≡ (p − 1)! ≡ − j2 ≡ (−1)(p−1)/2 ! mod p. 2
**

1≤ j≤(p−1)/2

Å

ã p−1 ! ≡ −1 2

mod p.

224 Example (IMO 1970) Find the set of all positive integers n with the property that the set

{n, n + 1, n + 2, n + 3, n + 4, n + 5} can be partitioned into two sets such that the product of the numbers in one set equals the product of the numbers in the other set. Solution: We will show that no such partition exists. Suppose that we can have such a partition, with one of the subsets having product of its members equal to A and the other having product of its members equal to B. We might have two possibilities. The ﬁrst possibility is that exactly one of the numbers in the set {n, n + 1, n + 2, n + 3, n + 4, n + 5} is divisible by 7, in which case exactly one of A or B is divisible by 7, and so A · B is not divisible by 72 , and so A · B is not a square. The second possibility is that all of the members of the set are relatively prime to 7. In this last case we have n(n + 1) · · ·(n + 6) ≡ 1 · 2 · · ·6 ≡ A · B ≡ −1 mod 7.

But if A = B then we are saying that there is an integer A such that A2 ≡ −1 mod 7, which is an impossibility, as −1 is not a square mod 7. This ﬁnishes the proof.

aa1 . Then ordn a|φ (n).8 If p is an odd prime prove that n p ≡ n mod 2p for all integers n.1. Answer: p = 3 only.12 Prove that 19|(22 integers k. Thus 31000 = (340 )25 ≡ 125 = 1 and so the last two digits are 01. 6 6 Problem 7. Proof: Let a1 . Then aφ (n) ≡ 1 mod n. a2 . n) = 1.1. . The proof is analogous to that of Fermat’s Little Theorem. mod n.5 If p is a prime prove that p|a p + (p − 1)!a for 1 ·3 · · · (p −2) ≡ 2 ·4 · · · (p −1) ≡ (−1) all integers a. 42) = 1 prove that 168|m − n . due to Euler.2 Prove that there are inﬁnitely many integers n with n|2n + 2. 340 ≡ 1 mod 100. Solution: As φ (100) = 40.1.1.1.1.1 Find all the natural numbers n for which 3|(n2n + 1).1.10 Prove that n > 1 is a prime if and only if (n − 1)! ≡ −1 mod n. As (a1 a2 · · · aφ (n) .1. 227 Example Find the last two digits of 31000 . by Euler’s Theorem. .u Using Theorem ?? we obtain the following corollary. aa2 . 226 Corollary Let (a.9 If p is an odd prime and p|m p + n p prove that p2 |m p + n p. Problem 7. .2 Euler’s Theorem In this section we obtain a generalisation of Fermat’s Little Theorem.1. Problem 7.3 Find all primes p such that p|2 p + 1. . n) = 1. . Problem 7.1. n) = 1. 2 2 2 2 2 2 (p−1)/2 Problem 7. aφ (n) be the canonical reduced residues mod n. . we may cancel the product a1 a2 · · · aφ (n) from both sides of the congruence to obtain Euler’s Theorem. Prove that q p−1 + pq−1 ≡ 1 mod pq.1. mod 100. 6k+2 + 3) for all nonnegative 7. Thus aa1 · aa2 · · · aaφ (n) ≡ a1 a2 · · · aφ (n) or aφ (n) a1 a2 · · · aφ (n) ≡ a1 a2 · · · aφ (n) mod n. Problem 7. aaφ (n) also forms a set of incongruent reduced residues. 225 Theorem (Euler’s Theorem) Let (a.4 If p and q are distinct primes prove that pq|(a pq − a p − aq − a) for all integers a. n) = 1.6 If (mn.Practice 81 Practice Problem 7.1.7 Let p and q be distinct primes. Problem 7. . Problem 7. As (a.11 Prove that if p is an odd prime mod p Problem 7. . Problem 7. Problem 7. .

we minimise n − m. . Upon assembling all this 77 This means that the last two digits are 07. s 1978100 ≡ 1 mod 125 This means that s = 20 and so s = 100.e. to the last three digits of 1978n. We now rule out the ﬁrst two possibilities. Now. (ii) (a + b)7 − a7 − b7 is divisible by 77 . Since 125|(1978 − 1) we have 5|(1978s − 1). Observe that 19784 ≡ (−22)4 ≡ 24 · 114 ≡ (4 · 121)2 ≡ (−16)2 ≡ 6 This means that s = 4. by Euler’s Theorem. b such that: (i) ab(a + b) is not divisible by 7. mod 125. 229 Example (IMO 1978) m. hence 716 ≡ 1 mod 40. 7(a6 b + ab6 + 3(a5b2 + a2 b5 ) + 5(a4b3 + a3 b4 )) 7ab(a5 + b5 + 3ab(a3 + b3) + 5(a2 b2 )(a + b)) 7ab(a + b)(a4 + b4 − a3 b − ab3 + a2 b2 +3ab(a2 − ab + b2) + 5ab) 7ab(a + b)(a4 + b4 + 2(a3b + ab3) + 3a2b2 ) 7ab(a + b)(a2 + ab + b2)2 . In their decimal representations. we take n −m = s = 100 and m = 3. respectively. i. and ﬁnally. Hence. We are given that 1978n − 1978m = 1978m(1978n−m − 1) is divisible by 1000 = 23 53 . this last congruence implies that s = 4. i.e. m = 3. Solution: We ﬁrst factorise (a + b)7 − a7 − b7 as ab(a + b)(a2 + ab + b2)2 . Now.3 s|100. the last three digits of 1000 ≡ 71+40t ≡ 7 · (740)t ≡ 7 mod 100. Find m.. Since the second factor is odd. Since s|100. 1000 = 16 · 62 + 8. 20. Solution: First observe that φ (100) = φ (22 )φ (52 ) = (22 − 2)(52 − 5) = 40. n are natural numbers with 1 ≤ m < n. Using the Binomial Theorem we have (a + b)7 − a7 − b7 = = = = = The given hypotheses can be thus simpliﬁed to (i)′ ab(a + b) is not divisible by 7. φ (40) = φ (23 )φ (5) = 4 · 4 = 16. 23 must divide the ﬁrst and so m ≥ 3. 740 ≡ 1 mod 100. Solution: As m + n = n − m + 2m. m + n = 106. n = 103. 1978m are equal.82 228 Example Find the last two digits of 77 1000 Chapter 7 . ord1251978 is the smallest positive integer s with 1978s ≡ 1 mod 125. This means that 71000 = 1 + 40t for some integer t. Similarly 197820 ≡ 19784 · (19784)4 ≡ 6 · 64 ≡ 6 · 46 ≡ 26 mod 125. 230 Example (IMO 1984) Find one pair of positive integers a. n such that m + n has its least value. 1978s ≡ 3s ≡ 1 mod 5. By Euler’s Theorem and so by Corollary 7. This means that 71000 ≡ (716 )62 78 ≡ 162 78 ≡ (74 )2 ≡ 12 ≡ 1 mod 40. Finally. or 100.. Justify your answer. (ii)′ a2 + ab + b2 is divisible by 73 . Since s is the smallest positive integer with 1978s ≡ 1 mod 125.

letting x = 2 we see that 298 ≡ 4 mod 7. Practice Problem 7. 2 10 Problem 7.4 Let p |10 be a prime.11 (Putnam 1985) Describe the sequence a1 = 3.1 Show that for all natural numbers s. We must verify now the conditions of non-divisibility.2. n n n Problem 7.2. Prove that mφ (n) + nφ (n) ≡ 1 mod mn. Using trial and error. an = 3an−1 mod 100 for large n. . For example. Now φ (73 ) = (7 − 1)72 = 3 · 98. b = 1.2 Prove that 504|n9 − n3 .2. Problem 7. such that the sum of the digits of n equals s. Problem 7. and so if x is not divisible by 7 we have (x98 )3 ≡ 1 mod 73 . As a3 − b3 = (a − b)(a2 + ab + b2).5 Find all natural numbers n that divide 1 + 2 + · · · + (n − 1) . Problem 7. n|(2 − 1).2.8 Find the remainder of 1010 + 1010 + · · · + 1010 upon division by 7. twos.2. .2. 11. n! Problem 7.Practice 83 As (a + b)2 > a2 + ab + b2 ≥ 73 . we ﬁnd that a = 1.2. Prove that p divides inﬁnitely many numbers of the form Problem 7. Problem 7. We leave to the reader to verify that a = 324. Problem 7. we obtain a + b ≥ 19. Let us look for more solutions by means of Euler’s Theorem. .6 Let (m. b = 18 give an answer.3 Prove that for odd integer n > 0.2. an = 7an−1 .10 (USAMO 1982) Prove that there exists a positive integer k such that k · 2n + 1 is composite for every positive integer n. Letting x = 3 we ﬁnd that 398 ≡ 324 mod 73 .2.2. (ii)’ is implied by ß 3 a ≡ b3 mod 73 ′′ (ii) a ≡ b mod 7. as 12 + 1 · 18 + 182 = 343 = 73 . Thus letting a = 298 . which gives the ﬁrst part of (ii)’. n) = 1.7 Find the last two digits of a1001 if a1 = 7. Problem 7.2. there is an integer n divisible by s.9 Prove that for every natural number n there exists some power of 2 whose ﬁnal n digits are all ones and 11 . b = 1 is another solution.

P(x) = x2 − 10x − 22. 24 From this we gather that n ≥ 2 (otherwise. Then this number can be written as 6 · 10n + y. but this equation has no integral solutions. The condition of the problem stipulates that 6 · 10n + y = 25 · y whence y= 6 · 10n . 231 Example Find all whole numbers which begin with the digit 6 and decrease 25 times when this digit is deleted. then a0 = x2 − 10x − 22. P(x) = 1. y has the form 250 · · ·0(n − 2 zeroes). 13. an−1 = 0. Now. where y is a number with n digits (it may begin with one or several zeroes). 0 ≤ a j ≤ 9. 0 . If x = 12. 6 · 10n would not be divisible by 24). Solution: Let x have the form x = a0 + a1 10 + a2102 + · · · + an−110n−1. If x had one digit.1 The Decimal Scale As we all know. 65789 = 6 · 104 + 5 · 103 + 7 · 102 + 8 · 10 + 9. So x2 − 10x − 22 < x. n−2 zeroes 232 Example (IMO 1968) Find all natural numbers x such that the product of their digits (in decimal notation) equals x2 − 10x − 22. For example. 84 . P(x) = a0 a1 · · · an−1 ≤ 9n−1 an−1 < 10n−1an−1 ≤ x (strict inequality occurs when x has more than one digit). We conclude that all the numbers sought have the form 625 0 . whence x has either one digit or x = 10. 11. Scales of Notation 8. Find all such numbers. y = 25 · 10k−2. that is. j ≥ 1. and we deduce that x < 13. Therefore. but x2 − 10x − 22 = 1. . . For n ≥ 2. If x = 11. x = 12 is the only solution. Solution: Let the number sought have n + 1 digits. ak ≤ 9. Let P(x) be the product of the digits of x.Chapter 8 n = a0 10k + a1 10k−1 + · · · + ak−1 10 + ak. If x = 10. 233 Example A whole number decreases an integral number of times when its last digit is deleted. P(x) = 2 and x2 − 10x − 22 = 2. P(x) = 0. but x2 − 10x − 22 = 0. any natural number n can be written in the form where 1 ≤ a0 ≤ 9.

. 44. . 14. and 99. m and x natural numbers. 55. etc. the number required is 103. and 999 = 33 · 37. there are 999 − (999/3 + 999/37) + 999/3 · 37 = 648 such numbers. for example.abc. This requires 10 + y/x = m. (In the last sum. fractions of the form s/37. 810. . . 0 ≤ j ≤ 9 for which a1 +a′ = a2 +a′ = · · · = a j +a′j = 0. Continuing in this fashion. an integer. a′ . 33. and 10x + y = mx. where we subtracted a 0 in order to eliminate 000. 234 Example Let A be a positive integer. 26. If y = 2.) As 463 − 1 = 33 · 5 · 7 · 103. There are 12 fractions of this kind. If y = 1. and we obtain the multiples of 10. 16. Solution: Clearly A and A′ must have ten digits. k ≥ 2. 3 |l. the fraction is already Solution: Observe that 0. 15. So. Prove that if A + A′ = 1010 . and thus not in S. b. If abc is neither divisible by 3 nor 37. we gather l a1 + a′ + a2 + a′ + · · · + a10 + a′ = 10 + 9(9 − j). how many different numerators are required? abc . 11. Notice that j = 0 implies that there are no sums of the form a j+k + a′j+k . any natural number x will do. a j+2 +a′j+2 = 1 2 a j+3 + a′j+3 = · · · = a10 + a′ = 9. 37 |s are in S. By the Inclusion-Exclusion Principle. To write the elements of S as fractions in lowest terms. 236 Example (AIME 1992) Let S be the set of all rational numbers r. . once for 110. 111 is repeated various times. and A′ be a number written with the aid of the same digits with are arranged in some other order. 28. . we just have to substitute the (possible) zeroes in the decimal representation. 18.The Decimal Scale 85 Solution: Let 0 ≤ y ≤ 9. Also. x = 1 or x = 2 and we obtain 12 and 22.abcabcabc . we see that the sinistral side of the above equality is the even number 2(a1 + a2 + · · · + s a10 ). and j = 9 10 implies that there are no sums of the form al + a′ . Now. a1 be the consecutive digits of A and A′ = a′ a′ . (If n has only one digit. x = 1. But this implies that a1 + a′ = 0. 17. 39. that have a repeating decimal expansion of the form 0.) The total number of distinct numerators in the set of reduced fractions is thus 640 + 12 = 660. . 800. 66. then A is divisible by 10. 1 ≤ l ≤ j. What is the largest prime factor of S? Solution: Observe that non-zero digits are the ones that matter. 19. 24. 1 2 10 Since the a′ are a permutation of the as .abcabcabc . and we obtain 11. where the digits a. 88. 77. and 811 have the same value p(n). because fractions of this form are greater than 1. which gives the result. once for 100. a j+1 +a′j+1 = 10. 10 9 1 A+A′ = 1010 if and only if there is a j. by 1’s. Let A = a10 a9 . Thus (0 + 1 + 2 · · · + 9)3 − 0 = 001 + 002 + · · ·+ 999. (Observe that we do not consider fractions of the form l/3t . . . where 3|s. = 0.22. the sought numbers are: the multiples of 10.) Let S = p(1) + p(2) + · · · + p(999). If y = 0. 13. and so p(1) + p(2) + · · · + p(n) = 111 + 112 + · · ·+ 999 = (1 + 1 + 2 + · · ·+ 9)3 − 1. 118. We obtain all the three digit numbers from 001 to 999 by expanding the product (0 + 1 + 2 + · · ·+ 9)3 − 0. In order to obtain p(n) for a particular number. 36. On adding all these sums. = 999 in lowest terms. We must have x|y. once for 011. the numbers 180. 37|s. once for 101. 0 < r < 1. 1 235 Example (AIME 1994) Given a positive integer n. 12. once for 001. then p(n) is equal to that digit. 48. let p(n) be the product of the non-zero digits of n. 108. This implies that j must be odd. c are not necessarily distinct. which equals 463 − 1.

The total number of digits in numbers with at most r digits is g(r) = r 10r − 1 10r − 1 j · 9 · 10r−1 = r10r − . b. reversed order.3 (AIME 1989) Suppose that n is a positive integer and d is a single digit in base-ten. Find the number of simple ordered pairs of nonnegative integers that sum 1492. Problem 8. let fn (k) = f1 ( fn−1 (k)).1.10 (AIME 1986) In the parlor game. 2! 3! 4! Problem 8. 1001. As 0 < < 10r . Find.12 (AIME 1988) For any positive integer k.11 The integer n is the smallest multiple of 15 let N be number obtained from m by writing the same digits in such that every digit of n is either 0 or 8.. we get (r − 1)10r < g(r) < r10r . where a. Problem 8. bac.gician” asks one of the participants to think of a three-digit number abc. Solution: Let n be an arbitrary positive integer with k digits. 238 Example (Putnam 1987) The sequence of digits 12345678910111213141516171819202122 . f (1987). Prove that at least one digit in the decimal representation of the number M + N is even. is obtained by writing the positive integers in order.1.m + n begin with 1234567890 and one of them is divisible by n. Therefore f (1987) = 1984. Problem 8.1. . Practice Problem 8. If the 10n digit of this sequence occurs in the part in which the m-digit numbers are placed. Solution: There are 9 · 10 j−1 j-digit positive integers. to add the number and to reveal their sum N. 810 Problem 8.d25d25d25d25 .1.1. because the hundredth digit enters the sequence in the placement of the two-digit integer 55.4 (AIME 1992) For how many pairs of consec. Prove that there is a positive integer n such that the decimal expansion of nt contains a 7.1.13 (IMO 1969) Determine all three-digit numprove that e is irrational. cab and cba. . let f1 (k) denote the square of the sums of the digits of k. bers N that are divisible by 11 and such that N/11 equals the . c represent the digits of the number utive integers in in the order indicated. .6 Given that n ≥ 2. The magician asks his victim to form {1000. For example f (2) = 2.1. . Find n if n = 0.1. . with proof. Then all of the n consecutive integers m + 1. Thus g(1983) < 1983 · 101983 < 9 9 j=1 104 · 101983 = 101987 and g(1984) > 1983 · 101984 > 103 · 101984.1. deﬁne f (n) to be m.1.5 Let m be a seventeen-digit positive integer and Problem 8. . . . . the “maProblem 8.86 Chapter 8 237 Example (Putnam 1956) Prove that every positive integer has a multiple whose decimal representation involves all 10 digits. n) of nonnegative integers is called simple if the addition m + n requires no carrying. 2000} the numbers acb.7 Let t be a positive real number.. Compute n/15. m + 2.8 (AIME 1988) Find the smallest positive integer whose cube ends in 888. If told the value of N. 1 1 1 e = 2 + + + + ··· .1. Problem 8. For Problem 8. Let m = 123456789 · 10k+1.1. .1. Problem 8. Problem 8. Find all whole numbers with that property.9 (AIME 1987) An ordered pair (m.2 A whole number is equal to the arithmetic mean of all the numbers obtained from the given number with the aid of all possible permutations of its digits. the magician can is no carrying required when the two integers are added? identity abc. Find f1988 (11).1 Prove that there is no whole number which decreases 35 times when its initial digit is deleted. Play the magician and determine abc if N = 319. Problem 8.

we can.45136. 87 Problem 8. Solution: Observe that 5213 < 75 . Let r ∈ Q and let ε > 0 be given.14 (IMO 1962) Find the smallest natural num. 16 6 62 63 4 + proper fraction = a1 + proper fraction. . a4 = 0. ﬁnd the last thousand digits of 1 + 50 + 502 + · · · + 50999.020408163265306122448979591836734693877551.Non-decimal Scales sum of the squares of the digits of N. ...1. such that 5213 = a4 74 + a373 + a2 72 + a1 7 + a0. such Problem 8. We gather that a2 = 5. the resulting number is four times as large as the original number.1. Continuing in this way we deduce that 5213 = 211257. we deduce that 13/16 = . a2 a3 Thus a1 = 4.41 is a perfect square in any scale of notation. 8.1.16 A Liouville number is a real number x such that for every positive k there exist integers a and b ≥ 2.41 is in scale r.15 is irrational. Now.. χ = 0. Solution: Write Multiply by 6 to obtain 13 a1 a2 a3 = + + + . . Problem 8. 2. Multiply by 62 to obtain 6 6 5 + proper fraction = a2 + proper fraction. . + 2 = 2+ r r r . however. 241 Example Prove that 4. of the other digits. . a4 ≤ 6. Prove that there exists a positive integer n such that |10n χ − r| < ε .2 Non-decimal Scales The fact that most people have ten ﬁngers has ﬁxed our scale of notation to the decimal.. . We thus want to ﬁnd 0 ≤ a0 . Thus a3 = 1. 240 Example Express the decimal number 13/16 in base-six. . Dividing 411 by 73 we obtain 1 + proper fraction = a3 + proper fraction. Since a4 is an integer.123456789101112131415161718192021 . it must be the case that a4 = 2. Prove or disprove that π is the sum of two Liouville numbers. Hence 13/16 − 4/6 = 7/48 = 2 + 3 + . Solution: If 4. Given any positive integer r > 1. then 4.1.41 = 4 + ã Å 1 2 4 1 . 239 Example Express the decimal number 5213 in base-seven. 1.that ber having last digit is 6 and if this 6 is erased and put in front |x − a/b| < b−k . divide by 74 to obtain 2 + proper fraction = a4 + proper fraction. express any number in base r. Thus 5213 − 2 · 74 = 411 = a3 73 + a2 72 + a1 7 + a0 . Continuing in this fashion. Show that Champernowne’s number Problem 8. .17 Given that 1/49 = 0.

But if a1 = a2 = · · · = a5 = 1. 12. This cannot be because 31a1 + 15a2 + 7a3 + 3a4 + a5 ≤ 31 + 15 + 7 + 3 + 1 = 57 < 60. From this we see that 63x − 6 < 12345 ≤ 63x. Find the hundredth term of the sequence. 2n The algorithm given just moves the binary point one unit to the right. .. 3. Does the equation Chapter 8 x + 2x + 4x + 8x + 16x + 32x = 12345 have a solution? Solution: We show that there is no such x. In the binary scale.a1 a2 a3 a4 a5 a6 a7 . 4x = 4 · 195 + 2a1 + a2 . 3. 1). 10. 110. then x0 = 1. = 0.a6 a7 a8 a9 a10 a11 a12 . Thus. 2.. . 31a1 + 15a2 + 7a3 + 3a4 + a5 = 60. Practice . . they comprise the positive integers which do not contain the digit 2. i. of course. 32x = 32 · 195 + 16a1 + 8a2 + 4a3 + 2a4 + a5. Then 2x = 2 · 195 + a1. . Thus x − 1 + 2x − 1 + 4x − 1 + · · ·+ 32x − 1 < ≤ x + 2x + 4x + 8x + 16x + 32x x + 2x + 4x + · · ·+ 32x. 111. . 13. the terms of the sequence in ascending order are thus 1. 2 2 2 with ak = 0 or 1. 101. . . 100. . let xn = for all integers n > 0. For how many x0 is it true that x0 = x5 ? Solution: Write x0 in base-two. . Hence 195 < x < 196. 16x = 16 · 195 + 8a1 + 4a2 + 2a3 + a4 . There are 25 = 32 such blocks. . Solution: If the terms of the sequence are written in base-3.e. 4. . To obtain the 100-th term of the sequence we just write 100 in binary 100 = 11001002 and translate this into ternary: 11001003 = 36 + 35 + 32 = 981. these numbers are. . The total number of values for which x0 = x5 is thus 32 − 1 = 31. which is outside [0. consists of all those positive integers which are powers of 3 or sums distinct powers of 3. .88 242 Example Let x denote the greatest integer less than or equal to x. For x0 to equal x5 we need 0. . Recall that x satisﬁes the inequalities x − 1 < x ≤ x. This will happen if and only if x0 has a repeating expansion with a1 a2 a3 a4 a5 as the repeating block . . 8x = 8 · 195 + 4a1 + 2a2 + a3 . 10. . Adding we ﬁnd that x + 2x + 4x + 8x + 16x + 32x = 63 · 195 + 31a1 + 15a2 + 7a3 + 3a4 + a5 . 243 Example (AHSME 1993) Given 0 ≤ x0 < 1. 244 Example (AIME 1986) The increasing sequence 1. 9. 1. Write then x in base-two: a1 a2 a3 x = 195 + + 2 + 3 + . . 11. x0 = k=1 ∞ ß 2xn−1 if 2xn−1 < 1 2xn−1 − 1 if 2xn−1 ≥ 1 an an = 0 or 1.

x2 .2. B(15) = B(11112) = 4. Problem 8. B(6) = B(1102) = 2. 1977) An ordered triple of in the form (−1)m a f (m) (g(m))! where a is an integer (x1 .6 Let C denote the class of positive integers which. x3 ) of positive irrational numbers with x1 + x2 + x3 = 1 and f .8 What is the largest integer that I should be “balancing act”: permitted to choose so that you may determine my number in twenty “yes” or “no” questions? B(x1 . For example. The exact power m of a prime p dividing n! is given by m= Proof: By De Polignac’s Formula n − (a0 + a1 + · · · + ak ) . 1981) Let E(n) denote the largest k such that 5k is an integral divisor of 11 22 33 · · · nn . x ≥ 0. when written in base-three. is called balanced if xn < 1/2 for all 1 ≤ n ≤ 3.A theorem of Kummer Problem 8. 1. Find the value of c. (P UTNAM 1981) Is ∞ xα (n) n3 converge? Problem 8. 1 2 3 8. x′ . If a triple is not balanced.3 (Putnam. 245 Theorem (Legendre) Let p be a prime and let n = a0 pk + a1 pk−1 + · · · + ak−1 p + ak be the base-p expansion of n. If the new triple i is not balanced. Problem 8. 1987) For each positive integer n.2. (P UTNAM 1984) Express 2m −1 (−1)B(n) nm n=0 Problem 8. x3 ) = (x′ . 1982) The base-eight representation of a perfect square is ab3c with a = 0. Calculate E(n) lim 2 .3 A theorem of Kummer We ﬁrst establish the following theorem. n→∞ n Problem 8. g are polynomials. x′ ).5 (Putnam.2 Prove that for x ∈ R.2. one performs the balancing act on it. For which positive real numbers x does the series ∞ n=1 89 where x′ = 2xi if xi = x j and x′j = 2x j − 1. pk .7 Let B(n) be the number of 1’s in the base-two expansion of n.2.2. one performs the following Problem 8. do not require the digit 2. exp n=1 B(n) n2 + n a rational number? 2. p−1 ∞ m= k=1 n . one has ∞ n=1 (−1) 2n 2n x = 1 − 2(x − x ).4 (AHSME. x2 . Show that no three integers in C are in arithmetic progression.2.1 (Putnam. Does continuation of this process always lead to a balanced triple after a ﬁnite number of performances of the balancing act? Problem 8. say x j > 1/2. let α (n) be the number of zeroes in the base-three representation of n.2.2.

ε0 + a1 + b1 = ε1 p + c1. . b j ≤ p − 1. + εk−1 pk = ε0 p + ε1 p2 + . Multiplying all these equalities successively by 1. +c0 + c1 p + · · · + ck pk We deduce that a + b = c0 + c1 p + · · · + ck pk + εk pk+1 . n/p2 = a0 pk−2 + a1 pk−3 + · · · + ak−2 . p2 . Sb = b j . (p − 1)m = (a + b) − Sa+b − a + Sa − b + Sb = (p − 1)(ε0 + ε1 + · · · + εk ). Thus ∞ n/pk k=1 = a0 (1 + p + p2 + · · · + pk−1 ) + a1(1 + p + p2 + · · · + pk−2 )+ · · · + ak−1 (1 + p) + ak pk − 1 pk−1 − 1 p2 − 1 p−1 = a0 + a1 + · · · + ak−1 + ak p−1 p−1 p−1 p−1 a0 pk + a1 pk−1 + · · · + ak − (a0 + a1 + · · · + ak ) = p−1 n − (a0 + a1 + · · · + ak ) . we obtain similarly: Sa + Sb + (ε0 + ε1 + · · · + εk−1 ) = (ε0 + ε1 + · · · + εk )p + Sa+b − εk . Proof: k j=0 Ç å a+b is equal to the a Let a = a0 + a1 p + · · · + ak pk . 0 ≤ c j ≤ p − 1. n/p = a0 pk−1 + a1 pk−2 + · · · ak−2 p + ak−1 . . p.90 Chapter 8 Now. = p−1 as wanted. By adding all the equalities above. and ak + bk > 0. b = b0 + b1 p + · · · + bk pk . Upon using Legendre’s result from above. . . which gives the result. b written in base p. . .u . . + εk−1 pk + εk pk+1 . . . ε1 + a2 + b2 = ε2 p + c2. and ε j = 0 or 1. n/pk = a0 .u 246 Theorem (Kummer’s Theorem) The exact power of a prime p dividing the binomial coefﬁcient number of “carry-overs” when performing the addition of a. . Let Sa = k j=0 a j . and adding them: a + b + ε0 p + ε1 p2 + . . . . be deﬁned as follows: a0 + b0 = ε0 p + c0. Let c j . 0 ≤ a j . . εk−1 + ak + bk = εk p + ck .

By the Unique Factorisation Theorem Å ã 1 1 1 1 + + 2 + ··· = . (9. But ã Å 1 1 1 + O(1). the product on the sinistral side of 2.1) p p n p≤x p prime n∈Fx Now.Chapter 9 p Miscellaneous Problems 247 Example Prove that 1 p p prime diverges. n∈Fx 1 1 > . Then Ü ê2 ∞ xp = p>2 p prime k=2 ak x2k ≤ C x4 . 1 − x2 91 . Solution: Let Fx denote the family consisting of the integer 1 and the positive integers n all whose prime factors are less than or equal to x. n n≤x n This ﬁnishes the proof.3 diverges as x → ∞. 1 − x2 This yields p>2 p prime x p−1 ≤ √ x C√ . As the harmonic series diverges. Assume that ak ≤ C ∀ k for some positive constant C.3. Solution: Let ak denote the number of ways in which 2k can be written as the sum of two odd primes. 1 + + 2 + ··· = p p p p≤x p≤x p prime p prime 248 Example Prove that for each positive integer k there exist inﬁnitely many even positive integers which can be written in more than k ways as the sum of two odd primes.

251 Example Let Qr.s mod p. since we are assuming ak ≥ 4. Hence the number of distinct rationals is r + s ≤ n − n/2 ≤ (n + 1)/2. vs+k = ck tk . But the leftmost series is divergent. Solution: Suppose that n a1 + a2 + · · · + an = 1976. ak . Now. . . n with equality if and only if a1 = a2 = · · · = an . Prove that the number of irreducible fractions a/b. ti |tk for some i. But then |sk /tk − si /ti | = |msi − sk |/tk ≥ 1/n. 1 ≤ k ≤ a be the set of numerators and denominators. say tk = mti . . r. Since 1976 = 3 · 658 + 2. We shall replace some of the ak so that the product is enlarged. . for every tk there are integers ck such that n/2 ≤ ck tk ≤ n. Let sk . but 2(ak − 2) ≥ ak . Thus we want to make the ak as equal as possible. contained in the given interval is at most (n + 1)/2. contradicting the hypothesis that the open interval is of length 1/n. Therefore. r!s! . but the sum remains the same. . for otherwise y j = yk would yield Solution: Divide the rational numbers in (x. but 23 < 32 . where n is a positive integer. where p is a prime (rs)! .ps ≡ Qr. thus we should take no more than two 2’s. we must take ak = 2 or ak = 3. . . 2. If we have an ak ≥ 4. with proof. in order to maximise the product. the largest possible product is 2 · 3658. . 1 ≤ b ≤ n.92 Integrating term by term. with denominators 1 ≤ tk ≤ n/2 and tk those uk /vk . The set of denominators is a subset of {1. We must take as many 2’s and 3’s as possible. . Then the sum is not affected. the largest number which is the product of positive integers whose sum is 1976. p>2 p prime Chapter 9 1 √ ≤ C p 1 0 √ x 1 − x2 dx = √ C. 2(a − 1)}. By the Pigeonhole Principle. 2. . sk }. we replace it by two numbers 2. Aliter: Suppose to the contrary that we have at least (n + 1)/2 + 1 = a fractions.tk . k = 1.s = Show that Qr. 2. 250 Example (USAMO 1983) Consider an open interval of length 1/n on the real line. Now. ak − 2. where all these fractions are in reduced form. yk+r = uk+r /vk+r . k = 1. and we obtain a contradiction. x + 1/n) into two sets: { |uk /vk − ui /vi | ≥ 1/vi ≥ 1/n. . 1 ≤ l ≤ r + s are equal. . 2 + 2 + 2 = 3 + 3. Deﬁne us+k = ck sk . s with denominators n/2 < vk ≤ n. which contradicts that the open interval is of length 1/n. 249 Example (IMO 1976) Determine. By we want to maximise k=1 the arithmetic mean-geometric mean inequality n 1/n ak k=1 ≤ a1 + a2 + · · · + an . No two of the yl . k.

s = j=1 93 r and Qr.7 (AIME 1987) Let M be the smallest positive square such that its ﬁrst two digits are equal to each other integer whose cube is of the form n + r. b. a3 +b3 +c3 −3abc = (a+b+c)(a2 +b2 +c2 −ab−bc−ca). . 2. 1/1000.3 Find all integral solutions of the equation x k! = yz .0. Problem 9.10 Prove that are inﬁnitely many nonnegative integers n which cannot be written as n = x2 + y3 + z6 for nonnegative integers x. Problem 9. x1985 . k=1 Problem 9.12 Show that there are inﬁnitely many integers x. Problem 9.0.0. .2 Find all integral solutions of the equation x Problem 9.1 Find a four-digit number which is a perfect Problem 9.0. Problem 9.0. Find integers a.ps = r j=1 it follows from that (1 + x) j ps−1 ≡ (1 + x p) js−1 (1 + x) p−1 Ç å Ç å jps − 1 js − 1 ≡ ps − 1 s−1 Ç Ç å jps − 1 .9 (AIME 1984) What is the largest even integer which cannot be written as the sum of two odd composite numbers? Problem 9.Practice Solution: As Qr. 0 < r < and its last two digits are equal to each other.5 Show that the Diophantine equation 1 1 1 1 1 + + . k=1 Problem 9.6 (AIME 1987) Find the largest possible value of k for which 311 is expressible as the sum of k consecutive positive integers.+ + + a1 a2 an−1 an a1 a2 · · · an has at least one solution for every n ∈ N. Problem 9. y such that 3x2 − 7y2 = −1. k! = y2 .0.0. ..13 Prove that 1. where n ∈ N.0. ps − 1 å js − 1 s−1 mod p mod p. . z.4 (USAMO 1985) Determine whether there are any positive integral solutions to the simultaneous equations 2 x1 + x2 + · · · + x2 = y3 .0. 2 1985 x3 + x3 + · · · + x3 = z2 1 2 1985 with distinct integers x1 .0. x2 .0. xn+1 + yn+1 = zn . whence the result.0. c such that 1987 = a3 + b3 + c3 − 3abc.0. Problem 9. Practice Problem 9. Problem 9.8 Determine two-parameter solutions for the “almost” Fermat Diophantine equations xn−1 + yn−1 = zn . . xn+1 + yn−1 = zn .11 Find the integral solutions of x2 + x = y4 + y3 + y2 + y. Find n. y..

Can you ﬁnd integers a. pb b Problem 9. Problem 9.0.28 (Putnam 1977) Let p be a prime and let a ≥ exists a sequence of k consecutive positive integers none of b > 0 be integers.25 Prove that the coefﬁcients of a binomial expansion are odd if and only if n is of the form 2k − 1.23 (Wostenholme’s Theorem) Let p > 3 be a prime. Problem 9.21 Determine an inﬁnite series of terms such that each term of the series is a perfect square and the sum for 0 < a < pk .20 (IMO 1977) In a ﬁnite sequence of real numbers. b 2 3 p−1 then p2 |a.0. c with 19872 = a3 + b3 + c3 − 3abc? Problem 9.0. Find polynomials P.0.0.30 Let p be a prime and let k. of the series at any point is also a perfect square. Prove that Ç å Ç å which can be represented as the sum of two squares. If a 1 1 1 = 1 + + + ··· + . Problem 9. and the sum of any eleven successive terms is positive. . a ∈ N. pa a ≡ mod p. R in x. 1. Problem 9.22 Prove that any positive rational integer can be expressed as a ﬁnite sum of distinct terms of the harmonic series. Chapter 9 Problem 9. 1/2.19 Prove that for every positive integer k there Problem 9.0. the sum of any seven successive terms is negative.18 Find all integers with x4 − 2y2 = 1. Problem 9.15 Prove that 19911991 is not the sum of two perfect squares.16 Find inﬁnitely many integers x > 1. a .0. Problem 9. Problem 9. Problem 9.0. a Problem 9. Show that Ç å p−1 ≡ (−1)k mod p k for all 0 ≤ k ≤ p − 1.0.14 Find all integers n such that n4 + n + 7 is a perfect square.0. pk ≡ 0 mod p. z such that P3 + Q3 + R3 − 3PQR = (x3 + y3 + z3 − 3xyz)2 4. Problem 9. . Problem 9.0.0..0.17 Find all positive integers with mn − nm = 1. 1/3. Ç å maximum number of terms in the sequence. Q.0. z > 1 such that x!y! = z!. .0. 0 ≤ a ≤ pk − 1.26 Let the numbers ci be deﬁned by the power series identity (1 + x + x2 + · · · + x p−1 )/(1 − x) p−1 := 1 + c1x + c2 x2 + · · · .0. Demonstrate that Ç å pk − 1 ≡ (−1)a mod p. y > 1.94 3.24 Prove that the number of odd binomial coefﬁcients in any row of Pascal’s Triangle is a power of 2. b. Show that ci ≡ 0 mod p for all i ≥ 1. Problem 9. Determine the Problem 9.27 Let p be a prime. y.0.29 Demonstrate that for a prime p and k ∈ N.

Sign up to vote on this title

UsefulNot useful- 360 Problems for Mathematical Contest
- A Path to Combinatorics For Undergraduates
- M3 all
- Computing Anticipatory Systems with Incursion and Hyperincursion
- fermat
- FA1-2009-1
- Scientia Magna international journal, Vol. 5 No 1
- Smarandache Semigroups, by W.B.Vasantha Kandasamy
- (Ultima Version) Libro Virtual de Refer en CIA Analisis Funcional II
- FP1 Solution Bank
- Problems with and without … Problems! (Translated from French), by Florentin Smarandache
- Treatise on Quantum Clifford Algebras - Fauser
- Measure Theory Notes - David Simms
- Ponnusamy Sugawa, Vuorinen. (Eds.) Quasiconformal Mappings and Their Applications. IWQCMA05 (Draft, Madras, 2006)(ISBN 8173198071)(358s)_MCc
- 250 Problems in Elementary Number Theory
- The NYC Contest Problem Book
- A Concise Introduction to the Theory of Numbers- Baker a.
- Clark W Edwin - Elementary Number Theory
- Mathematical Thinking - Problem Solving and Proofs
- The Contest Problem Book IX
- Algorithms and Complexity - Herbert S. Wilf
- Book Tot
- The Maths Contest Problem Book IX 2001-2007
- Analysis I (MA1101+MB1101) + Analysis II (MA1201+MB1201)
- [Alan Schoenfeld] Mathematical Problem Solving(BookFi.org)
- AP Calculus Multiple-Choice Question Collection 1969-1998
- Number Theory Book

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.