Elementary Number Theory:
Primes, Congruences, and Secrets

William Stein

Updated: January 2017



This is a textbook about classical elementary number theory and elliptic curves. The first part discusses elementary topics such as primes, factorization, continued fractions, and quadratic forms, in the context of cryptography, computation, and deep open research problems. The second part is about elliptic curves, their applications to algorithmic problems, and their connections with problems in number theory such as Fermats Last Theorem, the Congruent Number Problem, and the Conjecture of Birch and Swinnerton-Dyer. The intended audience of this book is an undergraduate with some familiarity with basic abstract algebra, e.g. rings, fields, and finite abelian groups.

On November 2008, this book was published by Springer-Verlag and can be purchased from Amazon.com. Springer-Verlag has also very generously agreed to let me make this book completely free online. So please feel free to download it:

Free Legal PDF of this book

In 2017, Pyung-Lyun Kang translated the complete book to Korean:

Free Legal Korean Version

Also, see github for the book's LaTeX source code and newer versions.

Of course, I would greatly appreciate it if you support the book by buying it.

This book is based upon work supported by the National Science Foundation under Grant No. 0653968. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.