What Is Number Theory? 1
1 The Integers 5
1.1 Numbers and Sequences 6
1.2 Sums and Products 16
1.3 Mathematical Induction 23
1.4 The Fibonacci Numbers 30
1.5 Divisibility 37
2 Integer Representations and Operations 43
2.1 Representations of Integers 43
2.2 Computer Operations with Integers 53
2.3 Complexity of Integer Operations 60
3 Primes and Greatest Common Divisors 67
3.1 Prime Numbers 68
3.2 The Distribution of Primes 77
3.3 Greatest CommonDivisors 90
3.4 The Euclidean Algorithm 97
3.5 The Fundamental Theorem of Arithmetic 108
3.6 Factorization Methods and the Fermat Numbers 123
3.7 Linear Diophantine Equations 133
4 Congruences 141
4.1 Introduction to Congruences 141
4.2 Linear Congruences 153
4.3 The Chinese Remainder Theorem 158
4.4 Solving Polynomial Congruences 168
4.5 Systems of Linear Congruences 174
4.6 Factoring Using the Pollard Rho Method 184
5 Applications of Congruences 189
5.1 Divisibility Tests 189
5.2 The Perpetual Calendar 195
5.3 Round-Robin Tournaments 200
5.4 Hashing Functions 202
5.5 Check Digits 207
6 Some Special Congruences 215
6.1 Wilson's Theorem and Fermat's Little Theorem 215
6.2 Pseudoprimes 223
6.3 Euler's Theorem 233
7 Multiplicative Functions 239
7.1 The Euler Phi-Function 239
7.2 The Sum and Number of Divisors 250
7.3 Perfect Numbers and Mersenne Primes 257
7.4 M?bius Inversion 269
8 Cryptology 277
8.1 Character Ciphers 278
8.2 Block and Stream Ciphers 286
8.3 Exponentiation Ciphers 305
8.4 Public Key Cryptography 308
8.5 Knapsack Ciphers 316
8.6 Cryptographic Protocols and Applications 323
9 Primitive Roots 333
9.1 The Order of an Integer and Primitive Roots 334
9.2 Primitive Roots for Primes 341
9.3 The Existence of Primitive Roots 347
9.4 Index Arithmetic 355
9.5 Primality Tests Using Orders of Integers and Primitive Roots 365
9.6 Universal Exponents 372
10 Applications of Primitive Roots and the Order of an Integer 379
10.1 Pseudorandom Numbers 379
10.2 The ElGamal Cryptosystem 389
10.3 An Application to the Splicing of Telephone Cables 394
11 Quadratic Residues 401
11.1 Quadratic Residues and Nonresidues 402
11.2 The Law of Quadratic Reciprocity 417
11.3 The Jacobi Symbol 430
11.4 Euler Pseudoprimes 439
11.5 Zero-Knowledge Proofs 448
12 Decimal Fractions and Continued Fractions 455
12.1 Decimal Fractions 455
12.2 Finite Continued Fractions 468
12.3 Infinite Continued Fractions 478
12.4 Periodic Continued Fractions 490
12.5 Factoring Using Continued Fractions 504
13 Some Nonlinear Diophantine Equations 509
13.1 Pythagorean Triples 510
13.2 Fermat's Last Theorem 516
13.3 Sums of Squares 528
13.4 Pell's Equation 539
14 The Gaussian Integers 547
14.1 Gaussian Integers and Gaussian Primes 547
14.2 Greatest Common Divisors and Unique Factorization 559
14.3 Gaussian Integers and Sums of Squares 570
A Axioms for the Set of Integers 577
B Binomial Coefficients 581
C Using Maple and Mathematica for Number Theory 589
C.1 Using Maple forNumberTheory 589
C.2 Using Mathematica for Number Theory 593
D Number Theory Web Links 599
E Tables 601
Answers to Odd-Numbered Exercises 617
Bibliography 689
Index of Biographies 703
Index 705
Photo Credits 721