\contentsline {section}{{\bf Preface}}{3}
\contentsline {chapter}{\numberline {1}Primes and Congruences}{9}
\contentsline {section}{\numberline {1.1}Prime Factorization}{9}
\contentsline {subsection}{\numberline {1.1.1}Prime Numbers}{9}
\contentsline {subsection}{\numberline {1.1.2}The Greatest Common Divisor}{10}
\contentsline {subsubsection}{Euclid's Algorithm for Computing GCDs}{11}
\contentsline {subsection}{\numberline {1.1.3}Numbers Do Factor}{12}
\contentsline {subsubsection}{A \$10,000 Challenge}{13}
\contentsline {subsection}{\numberline {1.1.4}The Fundamental Theorem of Arithmetic}{13}
\contentsline {section}{\numberline {1.2}The Sequence of Prime Numbers}{13}
\contentsline {subsection}{\numberline {1.2.1}There are Infinitely Many Primes}{14}
\contentsline {subsection}{\numberline {1.2.2}Primes of the Form $ax+b$}{15}
\contentsline {subsection}{\numberline {1.2.3}How Many Primes are There?}{16}
\contentsline {subsubsection}{Counting Primes Today}{17}
\contentsline {subsubsection}{The Riemann Hypothesis}{18}
\contentsline {section}{\numberline {1.3}Congruences}{18}
\contentsline {subsection}{\numberline {1.3.1}Notation}{18}
\contentsline {subsection}{\numberline {1.3.2}Arithmetic Modulo\nobreakspace {}$N$}{19}
\contentsline {subsubsection}{Cancellation}{19}
\contentsline {subsubsection}{Rules for Divisibility}{19}
\contentsline {subsection}{\numberline {1.3.3}Linear Congruences}{20}
\contentsline {subsection}{\numberline {1.3.4}Fermat's Little Theorem}{21}
\contentsline {subsubsection}{Group-theoretic Interpretation}{22}
\contentsline {subsection}{\numberline {1.3.5}What happened?}{22}
\contentsline {section}{\numberline {1.4}Congruences, Part II}{22}
\contentsline {subsection}{\numberline {1.4.1}Wilson's Theorem}{22}
\contentsline {subsection}{\numberline {1.4.2}The Chinese Remainder Theorem}{23}
\contentsline {subsection}{\numberline {1.4.3}Multiplicative Functions}{25}
\contentsline {section}{\numberline {1.5}Congruences, Part III}{26}
\contentsline {subsection}{\numberline {1.5.1}How to Solve $ax\equiv 1\penalty \z@ \mkern 8mu({\mathgroup \symoperators mod}\mkern 6mun)$}{26}
\contentsline {subsubsection}{More About GCDs}{26}
\contentsline {subsubsection}{To solve $ax\equiv 1\penalty \z@ \mkern 8mu({\mathgroup \symoperators mod}\mkern 6mun)$}{27}
\contentsline {subsection}{\numberline {1.5.2}How to Compute $a^m\penalty \z@ \mkern 8mu({\mathgroup \symoperators mod}\mkern 6mun)$ Efficiently}{28}
\contentsline {subsection}{\numberline {1.5.3}A Probabilistic Primality Test}{29}
\contentsline {subsubsection}{Finding large numbers that are probably prime}{30}
\contentsline {chapter}{\numberline {2}Public-key Cryptography}{33}
\contentsline {section}{\numberline {2.1}Diffie-Hellman Key Exchange}{33}
\contentsline {subsection}{\numberline {2.1.1}Public-key Cryptography}{33}
\contentsline {subsection}{\numberline {2.1.2}The Diffie-Hellman Key Exchange Protocol}{33}
\contentsline {subsubsection}{Some Quotes}{34}
\contentsline {subsection}{\numberline {2.1.3}Let's try it!}{35}
\contentsline {subsection}{\numberline {2.1.4}The Discrete Logarithm Problem}{36}
\contentsline {subsubsection}{The State of the Art}{37}
\contentsline {subsection}{\numberline {2.1.5}Realistic Example}{37}
\contentsline {section}{\numberline {2.2}The RSA Cryptosystem}{38}
\contentsline {subsection}{\numberline {2.2.1}How RSA works}{38}
\contentsline {subsubsection}{One-way Functions}{38}
\contentsline {subsubsection}{How Nikita Makes an RSA Public Key}{39}
\contentsline {subsubsection}{Sending Nikita an Encrypted Message}{39}
\contentsline {subsubsection}{How Nikita Decrypts a Message}{40}
\contentsline {subsection}{\numberline {2.2.2}Encoding a Phrase in a Number}{40}
\contentsline {subsubsection}{How Many Letters Can a Number ``Hold''?}{40}
\contentsline {subsection}{\numberline {2.2.3}Examples}{40}
\contentsline {subsubsection}{A Small Example}{40}
\contentsline {subsubsection}{A Bigger Example in PARI}{41}
\contentsline {subsection}{\numberline {2.2.4}A Connection Between Breaking RSA and Factoring Integers}{43}
\contentsline {section}{\numberline {2.3}Attacking RSA}{43}
\contentsline {subsection}{\numberline {2.3.1}Factoring $n$ Given $\varphi (n)$}{44}
\contentsline {subsection}{\numberline {2.3.2}When\nobreakspace {}$p$ and\nobreakspace {}$q$ Are Close}{44}
\contentsline {subsection}{\numberline {2.3.3}Factoring\nobreakspace {}$n$ Given\nobreakspace {}$d$}{45}
\contentsline {subsection}{\numberline {2.3.4}RSA Challenge $n$}{47}
\contentsline {chapter}{\numberline {3}Quadratic Reciprocity}{51}
\contentsline {section}{\numberline {3.1}Primitive Roots}{51}
\contentsline {subsection}{\numberline {3.1.1}Polynomials over $\@mathbb {Z}/p\@mathbb {Z}$}{51}
\contentsline {subsection}{\numberline {3.1.2}The Structure of $(\@mathbb {Z}/p\@mathbb {Z})^* = \{1,2,\ldots , p-1\}$}{52}
\contentsline {subsection}{\numberline {3.1.3}Artin's Conjecture}{54}
\contentsline {section}{\numberline {3.2}Quadratic Reciprocity I}{54}
\contentsline {subsection}{\numberline {3.2.1}Euler's Criterion}{54}
\contentsline {subsection}{\numberline {3.2.2}The Quadratic Reciprocity Law}{56}
\contentsline {subsection}{\numberline {3.2.3}A Lemma of Gauss}{57}
\contentsline {section}{\numberline {3.3}Quadratic Reciprocity II}{58}
\contentsline {subsection}{\numberline {3.3.1}Recall Gauss's Lemma}{58}
\contentsline {subsection}{\numberline {3.3.2}Euler's Conjecture}{58}
\contentsline {subsection}{\numberline {3.3.3}The Quadratic Reciprocity Law}{60}
\contentsline {subsubsection}{Examples}{61}
\contentsline {chapter}{\numberline {4}Continued Fractions}{63}
\contentsline {section}{\numberline {4.1}Finite Continued Fractions}{64}
\contentsline {subsubsection}{Partial Convergents}{64}
\contentsline {subsubsection}{How the Convergents Converge}{66}
\contentsline {subsection}{\numberline {4.1.1}Every Rational Number is Represented}{66}
\contentsline {section}{\numberline {4.2}Infinite Continued Fractions}{67}
\contentsline {subsection}{\numberline {4.2.1}The Continued Fraction Algorithm}{67}
\contentsline {subsection}{\numberline {4.2.2}Infinite Continued Fractions}{69}
\contentsline {section}{\numberline {4.3}Quadratic Irrationals}{71}
\contentsline {subsection}{\numberline {4.3.1}Quadratic Irrationals}{72}
\contentsline {subsection}{\numberline {4.3.2}Periodic Continued Fractions}{72}
\contentsline {subsection}{\numberline {4.3.3}What About Higher Degree?}{74}
\contentsline {section}{\numberline {4.4}Applications}{75}
\contentsline {subsection}{\numberline {4.4.1}Recognizing Rational Numbers}{75}
\contentsline {subsection}{\numberline {4.4.2}Pell's Equation}{76}
\contentsline {subsection}{\numberline {4.4.3}Units in Real Quadratic Fields}{77}
\contentsline {subsection}{\numberline {4.4.4}Some Proofs}{79}
\contentsline {chapter}{\numberline {5}Binary Quadratic Forms}{83}
\contentsline {section}{\numberline {5.1}Sums of Two Squares}{83}
\contentsline {subsection}{\numberline {5.1.1}Which Numbers are the Sum of Two Squares?}{83}
\contentsline {subsection}{\numberline {5.1.2}Computing $x$ and $y$}{86}
\contentsline {subsection}{\numberline {5.1.3}Sums of More Squares}{86}
\contentsline {section}{\numberline {5.2}Binary Quadratic Forms}{86}
\contentsline {subsection}{\numberline {5.2.1}Introduction}{86}
\contentsline {subsection}{\numberline {5.2.2}Equivalence}{87}
\contentsline {subsection}{\numberline {5.2.3}Discriminants}{88}
\contentsline {subsection}{\numberline {5.2.4}Definite and Indefinite Forms}{89}
\contentsline {subsection}{\numberline {5.2.5}Real Life}{89}
\contentsline {section}{\numberline {5.3}Reduction Theory}{90}
\contentsline {subsection}{\numberline {5.3.1}Reduced Forms}{91}
\contentsline {subsection}{\numberline {5.3.2}Finding an Equivalent Reduced Form}{92}
\contentsline {subsection}{\numberline {5.3.3}Some PARI Code}{93}
\contentsline {section}{\numberline {5.4}The Class Group}{94}
\contentsline {subsection}{\numberline {5.4.1}Can You Hear the Shape of a Lattice?}{94}
\contentsline {subsection}{\numberline {5.4.2}Class Numbers}{95}
\contentsline {subsection}{\numberline {5.4.3}The Class Group}{99}
\contentsline {chapter}{\numberline {6}Elliptic Curves}{103}
\contentsline {section}{\numberline {6.1}Introduction}{103}
\contentsline {subsection}{\numberline {6.1.1}The Definition}{103}
\contentsline {subsection}{\numberline {6.1.2}Linear and Quadratic Diophantine Equations}{104}
\contentsline {subsection}{\numberline {6.1.3}Points on Elliptic Curves}{104}
\contentsline {subsubsection}{To Infinity!}{105}
\contentsline {subsection}{\numberline {6.1.4}The Group Law}{106}
\contentsline {subsection}{\numberline {6.1.5}Mordell's Theorem}{107}
\contentsline {section}{\numberline {6.2}The Elliptic Curve Group Law}{107}
\contentsline {subsection}{\numberline {6.2.1}Some Graphs}{107}
\contentsline {subsection}{\numberline {6.2.2}The Point $\@mathcal {O}$ at Infinity}{109}
\contentsline {subsection}{\numberline {6.2.3}The Group Law is a Group Law}{110}
\contentsline {subsection}{\numberline {6.2.4}An Example Over a Finite Field}{111}
\contentsline {subsection}{\numberline {6.2.5}Mordell's Theorem}{111}
\contentsline {section}{\numberline {6.3}Torsion Points and Mazur's Big Theorem}{112}
\contentsline {subsection}{\numberline {6.3.1}Mordell's Theorem}{112}
\contentsline {subsection}{\numberline {6.3.2}Exploring the Possibilities}{113}
\contentsline {subsubsection}{The Torsion Subgroup}{113}
\contentsline {subsubsection}{The Rank}{114}
\contentsline {subsection}{\numberline {6.3.3}How to Compute $E(\@mathbb {Q})_{\tor }$}{115}
\contentsline {chapter}{\numberline {7}Applications of Elliptic Curves}{121}
\contentsline {section}{\numberline {7.1}Cryptography}{121}
\contentsline {subsection}{\numberline {7.1.1}Microsoft Digital Rights Management}{121}
\contentsline {subsubsection}{Microsoft's Favorite Elliptic Curve}{122}
\contentsline {subsubsection}{Nikita and Michael}{122}
\contentsline {subsection}{\numberline {7.1.2}The Elliptic Curve Discrete Logarithm Problem}{123}
\contentsline {subsection}{\numberline {7.1.3}ElGamal}{123}
\contentsline {subsection}{\numberline {7.1.4}Why Use Elliptic Curves?}{125}
\contentsline {section}{\numberline {7.2}Factorization}{125}
\contentsline {subsection}{\numberline {7.2.1}Power-Smoothness}{126}
\contentsline {subsection}{\numberline {7.2.2}Pollard's $(p-1)$-Method}{127}
\contentsline {subsection}{\numberline {7.2.3}Pollard's Method in Action!}{128}
\contentsline {subsection}{\numberline {7.2.4}Motivation for the Elliptic Curve Method}{129}
\contentsline {subsection}{\numberline {7.2.5}The Elliptic Curve Method}{130}
\contentsline {subsection}{\numberline {7.2.6}The Elliptic Curve Method (ECM)}{130}
\contentsline {subsection}{\numberline {7.2.7}Implementation and Examples}{131}
\contentsline {subsection}{\numberline {7.2.8}How Good is ECM?}{134}
\contentsline {section}{\numberline {7.3}Fermat's Last Theorem and Modularity}{134}
\contentsline {subsection}{\numberline {7.3.1}Fermat's Last Theorem}{134}
\contentsline {subsection}{\numberline {7.3.2}Holomorphic Functions}{135}
\contentsline {subsection}{\numberline {7.3.3}Cuspidal Modular Forms}{136}
\contentsline {subsubsection}{The Dimension of $S_2(\Gamma _0(N))$}{137}
\contentsline {subsection}{\numberline {7.3.4}Modularity of Elliptic Curves}{137}
\contentsline {chapter}{\numberline {8}The Birch and Swinnerton-Dyer Conjecture}{139}
\contentsline {section}{\numberline {8.1}Introduction}{139}
\contentsline {section}{\numberline {8.2}The Conjecture}{142}
\contentsline {subsection}{\numberline {8.2.1}The BSD Conjecture}{142}
\contentsline {subsection}{\numberline {8.2.2}What is Known}{142}
\contentsline {subsection}{\numberline {8.2.3}How to Compute $L(E,s)$ with a Computer}{143}
\contentsline {subsubsection}{Best Models}{143}
\contentsline {subsubsection}{Formula for $L(E,s)$}{143}
\contentsline {section}{\numberline {8.3}A Rationality Theorem}{144}
\contentsline {section}{\numberline {8.4}Approximating the Rank}{145}
\contentsline {chapter}{\numberline {9}Computing With PARI/GP}{149}
\contentsline {section}{\numberline {9.1}Introduction}{149}
\contentsline {subsection}{\numberline {9.1.1}Some Assertions About Primes}{150}
\contentsline {subsection}{\numberline {9.1.2}Some Tools for Computing}{153}
\contentsline {subsection}{\numberline {9.1.3}Getting Started with PARI}{153}
\contentsline {subsubsection}{Documentation}{153}
\contentsline {subsubsection}{A Short Tour}{153}
\contentsline {subsubsection}{Help in PARI}{154}
\contentsline {section}{\numberline {9.2}Pari Programming}{156}
\contentsline {subsection}{\numberline {9.2.1}Beyond One Liners}{156}
\contentsline {subsubsection}{Reading Files}{156}
\contentsline {subsubsection}{Arguments}{156}
\contentsline {subsubsection}{Local Variables Done Right}{157}
\contentsline {subsubsection}{Making Your Program Listen}{158}
\contentsline {subsubsection}{Writing to Files}{158}
\contentsline {subsection}{\numberline {9.2.2}Coming Attractions}{159}
\contentsline {section}{\numberline {9.3}Computing with Elliptic Curves}{159}
\contentsline {subsection}{\numberline {9.3.1}Initializing Elliptic Curves}{159}
\contentsline {subsection}{\numberline {9.3.2}Computing in The Group}{160}
\contentsline {subsection}{\numberline {9.3.3}The Generating Function $L(E,s)$}{161}
\contentsline {subsubsection}{A Curve of Rank Two}{163}
\contentsline {subsubsection}{A Curve of Rank Three}{163}
\contentsline {subsubsection}{A Curve of Rank Four}{164}
\contentsline {subsection}{\numberline {9.3.4}Other Functions and Programs}{165}
\contentsline {chapter}{\numberline {10}Solutions to Exercises}{167}
\contentsline {chapter}{\numberline {}References}{181}
