Abakcus
← Back to home

Abakcus — Book Lists

The 21 Best Number Theory Books, in Reading Order

From the books that make primes a story to the ones that prove Fermat's questions properly. 21 number theory books in five steps, two of them free.

Ten number theory books laid out in two rows, among them The Music of the Primes, Fermat's Enigma, Hardy and Wright, and Gauss's Disquisitiones Arithmeticae

Tap a cover to open the book.

21

books, in the order to read them

5

steps, from the first prime to Gauss's own book

219

years between the oldest book (1801) and the newest (2020)

2

of them free to read online, legally

Number theory is the study of the whole numbers, the ones children count on their fingers, and it is the oldest unfinished business in mathematics. Euclid proved more than two thousand years ago that the primes never run out. Nobody has yet proved that every even number from 4 upward is the sum of two primes, though any child can check the first hundred cases in an afternoon. No other subject puts such easy questions next to such hard answers.

For most of its history it was also the purest of pure mathematics, studied for its beauty and for no other reason. G. H. Hardy boasted that nothing he had done in it would ever be of the slightest practical use. Then, in the 1970s, the difficulty of breaking a large number into its prime factors became the lock on the world's encrypted messages. Every card payment you make today rests on theorems about primes.

The 21 books here are in five steps. The first gives you the story, with no exercises. The second is a first textbook, which is where you start doing number theory yourself, with nothing more than school algebra and patience. The third is problems. The fourth goes on into the modern subject, and the last goes back to the sources, including the book in which Gauss founded the field as we know it.

Two of the textbooks are free and I have marked them. If you have never written a proof, number theory is the best place to learn, but you may want a book on proofs beside you. And if you only want to look at the primes for a while first, I collected some of my favourites in interesting prime numbers.

In a hurry

Which number theory book should you start with?

Before the books

Four questions to try first

  • Question 1 · A proof

    Is there a largest prime?

    The primes thin out as numbers grow: there are 25 below 100 but only 21 between 100 and 200. Could they eventually stop altogether?

    Show the answer

    No. Take any finite list of primes, multiply them all together and add 1. The new number leaves a remainder of 1 when divided by every prime on the list, so its prime factors are all missing from the list. Whatever list you start with, there is always another prime. This is Euclid's proof, more than two thousand years old.

    More proofs like this in Wilson
  • Question 2 · Clock arithmetic

    A hundred days from Monday

    Today is Monday. What day of the week will it be in 100 days, and in 1,000 days? You may not count on a calendar.

    Show the answer

    Only the remainder on division by 7 matters. 100 = 14 × 7 + 2, so it will be two days after Monday, a Wednesday. 1,000 = 142 × 7 + 6, so it will be a Sunday. Arithmetic with remainders, which Gauss called congruences, is the first real tool of number theory.

    Congruences, gently, in Silverman
  • Question 3 · A pattern

    Sums of two squares

    13 = 4 + 9 and 29 = 4 + 25 are sums of two squares. Can 19 and 31 be written that way? Which primes can?

    Show the answer

    19 and 31 cannot. An odd prime is a sum of two squares exactly when it leaves a remainder of 1 on division by 4, which 13 and 29 do and 19 and 31 do not. Fermat stated this in 1640 and Euler proved it about a century later. Asking the same question for x² + 2y², x² + 3y² and so on leads straight into modern number theory.

    Where this question leads, in Cox
  • Question 4 · An open problem

    Two primes for every even number

    4 = 2 + 2, 6 = 3 + 3, 8 = 3 + 5, 10 = 5 + 5 = 3 + 7. Is every even number from 4 upward the sum of two primes?

    Show the answer

    Nobody knows. Christian Goldbach suggested it in a letter to Euler in 1742, and it has been checked by computer for every even number up to 4 × 10¹⁸, but there is still no proof. It is one of the oldest open problems in mathematics.

    The state of play in Ribenboim

Step I · Books 01–04

Meet the primes

Four books with no exercises. Read one first and the textbooks that follow will be answering questions you already care about.

No. 01 · Step I

The Music of the Primes

Marcus du Sautoy · 2003

Marcus du Sautoy is a professor of mathematics at Oxford, and this is the book that made his name as a writer. Its subject is the Riemann hypothesis, a claim made in 1859 about where the primes fall among the whole numbers, which is the most famous unsolved problem in mathematics and carries a prize of a million dollars.

Du Sautoy tells it as a story of people: Gauss guessing at the density of the primes as a teenager, Riemann turning the question into one about a function of complex numbers, Hilbert putting it on his list of problems for the twentieth century, and the physicists who noticed that the hidden pattern in the primes looks like the energy levels of atoms. There are no formulas you need to follow. It is the best introduction to why number theorists find the primes so beautiful, and it sits beside other books of its kind in books dedicated to a single problem.

Best forAnyone who wants to know why mathematicians are obsessed with prime numbers.

No. 02 · Step I

Fermat's Enigma

Simon Singh · 1997

Around 1637 Pierre de Fermat wrote in the margin of his copy of an ancient Greek arithmetic book that the equation xⁿ + yⁿ = zⁿ has no solutions in whole numbers when n is greater than 2. He added that he had a truly marvellous proof, which the margin was too small to contain. For more than 350 years nobody could find one.

Simon Singh tells the whole history, from Pythagoras to the Englishman Andrew Wiles, who had dreamed of the problem since he was ten and worked on it in secret for seven years before announcing a proof in 1993. Then a gap was found, and the book's last chapters, in which Wiles spends a terrible year repairing it, are as tense as any thriller. Singh made a celebrated television documentary about it first, and the book has the same gift for making hard mathematics feel human.

Best forReaders who want a real mathematical detective story.

No. 03 · Step I

Number Theory: A Very Short Introduction

Robin Wilson · Oxford University Press · 2020

Robin Wilson has spent a long career teaching mathematics at the Open University, and he writes for people who are curious but busy. In about 150 small pages he covers what a first university course would: divisibility and the primes, congruences, the theorems of Fermat and Euler, sums of squares, Pythagorean triples, and the way all of this is now used in cryptography.

Unlike the two books above, this one shows you some of the arguments, so you get a taste of how number theorists actually think. The proofs are short and clearly set out, and none needs more than school algebra. It is the right book for someone deciding whether to take the subject further, and it belongs to a series I went through in the best Very Short Introductions.

Best forReaders who want the real ideas, briefly, with a few proofs along the way.

No. 04 · Step I

Closing the Gap: The Quest to Understand Prime Numbers

Vicky Neale · Oxford University Press · 2017

Do the primes keep coming in pairs that differ by 2, like 11 and 13 or 41 and 43, forever? Nobody knows. But in 2013 a little-known mathematician named Yitang Zhang proved that there are infinitely many pairs of primes no more than 70 million apart. It sounds like a modest result, and it was a sensation, because nobody had been able to prove any bound at all.

Within months an online collaboration of mathematicians had brought the 70 million down to 246. Vicky Neale, who teaches at Oxford, alternates chapters on that race with chapters on other problems about primes, and she shows research mathematics as it really is: collaborative, incremental and exciting. It is a short book and very readable. I also have it on my list of math books you can finish in one sitting.

Best forReaders who want to see how mathematical research happens today.

Step II · Books 05–10

A first textbook

Six books, of which you need one. They differ in voice, in price and in how far they go. Two are free.

No. 05 · Step II

A Friendly Introduction to Number Theory

Joseph H. Silverman · 1997, fourth edition 2012

Joseph Silverman is a research number theorist at Brown University, and he wrote this book for a course aimed at students who had never studied higher mathematics. It lives up to its title. Each short chapter starts from numerical experiments, asks the reader to look for a pattern, makes a guess, and only then proves it, which is exactly how number theory has always been done.

It covers the standard ground, from Pythagorean triples and the primes through congruences, Fermat's little theorem, quadratic reciprocity and sums of squares, and then goes further than most introductions, into RSA cryptography, continued fractions and a first look at elliptic curves. The exercises are numerous and often invite computer exploration. If I had to choose one book to learn the subject from, it would be this one.

Best forSelf-learners and students meeting proofs for the first time.

No. 06 · Step II

Elementary Number Theory

David M. Burton · 1976, seventh edition 2010

David Burton taught at the University of New Hampshire and was also a historian of mathematics, and his textbook has been one of the most widely used in American universities for half a century. It is more traditional than Silverman, with definitions, theorems and proofs set out in the classical order and large banks of graded exercises.

What makes it stand out is the history. Burton weaves the people into the mathematics throughout, so that Fermat, Euler, Lagrange and Gauss appear where their theorems do, and several chapters open with a short historical essay. It covers divisibility, primes, congruences, the classical theorems, number-theoretic functions, primitive roots, quadratic reciprocity and an introduction to cryptography. Older editions are cheap and just as good.

Best forStudents taking a standard undergraduate course.

No. 07 · Step II

Number Theory

George E. Andrews · 1971, Dover edition 1994

George Andrews is one of the world's leading experts on partitions, the different ways a whole number can be written as a sum, and his introductory textbook has an unusual flavour as a result. Wherever he can, he proves things by counting, using combinatorial arguments that make results feel inevitable in a way algebra sometimes does not.

The first part covers the standard elementary material, and the later chapters introduce partitions and the geometry of numbers, topics most first courses leave out. It is compact and written with great clarity. The Dover reprint costs very little, which makes it the cheapest serious textbook on the list after the free ones, and a good second book to read beside any of the others.

Best forReaders on a budget who like counting arguments.

No. 08 · Step II · Free edition

Elementary Number Theory: Primes, Congruences, and Secrets

William Stein · Springer · 2009

William Stein is a number theorist who also created SageMath, a free system for doing mathematics on a computer, and this textbook is built around it. Every topic comes with short pieces of code that let you test ideas on numbers far too large to handle by hand, which is how modern number theorists actually work.

The book is brief and focused. It covers primes and factorization, congruences, the public-key cryptography that protects the internet, quadratic reciprocity, continued fractions and, in a final chapter, elliptic curves and their use in cryptography. The author gives the whole book away as a PDF, and the printed edition is reasonably priced. If you like to learn by trying things, start here.

Best forProgrammers, and anyone who wants to experiment on a computer while they learn.

No. 09 · Step II · Free edition

A Computational Introduction to Number Theory and Algebra

Victor Shoup · Cambridge University Press · 2005, second edition 2008

Victor Shoup is a cryptographer at New York University, and he wrote this book for computer scientists who need number theory and algebra as working tools. It treats both subjects together, as they are used in practice, and it is always concerned with how to compute things efficiently as well as with what is true.

So alongside the usual theorems you get the algorithms: the Euclidean algorithm and its running time, fast modular exponentiation, primality testing, factoring, discrete logarithms, and the finite fields and polynomials that underlie modern codes. It is longer and more demanding than the other books in this step, and it is complete and careful. Shoup gives the entire book away free on his website.

Best forComputer science students and anyone heading for cryptography.

No. 10 · Step II

An Introduction to the Theory of Numbers

G. H. Hardy and E. M. Wright · 1938, sixth edition 2008

Two Oxford mathematicians wrote this book in the 1930s, and it has been the standard reference on elementary number theory ever since. The current edition was revised by two modern experts, Roger Heath-Brown and Joseph Silverman, who added notes and a chapter on elliptic curves, and it has a foreword by Andrew Wiles.

It is not quite a textbook. There are no exercises, and the chapters can be read in almost any order. What it offers is an enormous range, from the primes and congruences through continued fractions, approximation by rationals and the geometry of numbers to partitions and the distribution of primes, all written with an elegance few mathematics books have. Students tend to use it beside a course rather than instead of one. Hardy's own account of why he gave his life to such things is A Mathematician's Apology.

Best forReaders who want the classic reference, and have time to browse it.

Step III · Books 11–12

Practise on problems

Number theory is the favourite subject of mathematical competitions. Two problem books, one for younger students and one for olympiad level.

No. 11 · Step III

Introduction to Number Theory

Mathew Crawford · Art of Problem Solving · 2008

Art of Problem Solving is an American publisher and online school built around mathematical competitions, and its textbooks are written in an unusual way. Each section begins with problems, which the student is meant to attempt before reading any explanation, and the theory is then developed from the attempts. It is the opposite of a lecture, and it works.

This volume covers what a strong middle-school student needs: primes and factorization, divisors and multiples, number bases, units digits and modular arithmetic, all through hundreds of problems taken or adapted from contests. Full solutions are in a separate book. It is the best way I know to give a young student a real taste of number theory, and it leads naturally to the harder book below.

Best forStrong students from about eleven to fifteen, and their parents.

No. 12 · Step III

104 Number Theory Problems: From the Training of the USA IMO Team

Titu Andreescu, Dorin Andrica and Zuming Feng · Birkhäuser · 2007

Titu Andreescu coached the United States team for the International Mathematical Olympiad for a decade, and this book comes from that training. The first part is a compact but thorough course in the elementary number theory a competitor needs, with every idea illustrated by worked examples from real competitions.

Then come the 104 problems, half of them introductory and half advanced, with full solutions at the end. They are hard, and they are the kind of hard that rewards persistence rather than knowledge, which is the whole charm of competition number theory. Work through even a third of them and your feeling for divisibility and congruences will be transformed. For puzzles of a gentler kind, see the best math puzzle books.

Best forOlympiad students and anyone who likes hard elementary problems.

Step IV · Books 13–17

Into the modern subject

Five books for readers who have finished a first course. Expect abstract algebra, and in places complex analysis, to be assumed.

No. 13 · Step IV

A Classical Introduction to Modern Number Theory

Kenneth Ireland and Michael Rosen · Springer · 1982, second edition 1990

This is the book that most graduate students in number theory read first, and the title explains why. Ireland and Rosen take the classical questions of Gauss and his successors and answer them with modern tools, so that the reader moves from the familiar to the new without a jump.

It starts with unique factorization and congruences, which the reader has seen, and quickly broadens into the arithmetic of other number systems, Gauss and Jacobi sums, cubic and biquadratic reciprocity, the zeta function, and the counting of solutions to equations over finite fields. The final chapters reach elliptic curves and the arithmetic of algebraic number fields. The writing is clear, the exercises are excellent, and the historical remarks are a pleasure. You will need a course in abstract algebra first.

Best forStudents moving from elementary number theory to the real thing.

No. 14 · Step IV

A Course in Arithmetic

Jean-Pierre Serre · 1970, English edition 1973

Jean-Pierre Serre is one of the great mathematicians of the last century and among the clearest writers mathematics has had, and this little book shows both. In barely more than a hundred pages it covers two subjects that most authors would need a volume each for.

The first half is algebraic: finite fields, the p-adic numbers, quadratic forms over the rationals and the theorem of Hasse and Minkowski that a quadratic equation has a rational solution exactly when it has one in every completion. The second half is analytic: Dirichlet's theorem that every suitable arithmetic progression contains infinitely many primes, and an introduction to modular forms. Not a word is wasted, so you will read each page several times. Many mathematicians name it as the most beautiful textbook they know.

Best forReaders who admire concision, and are ready to work for it.

No. 15 · Step IV

Primes of the Form x² + ny²

David A. Cox · Wiley · 1989, second edition 2013

Fermat knew which primes can be written as x² + y²: exactly 2 and the primes that leave remainder 1 on division by 4. He also knew the answers for x² + 2y² and x² + 3y². David Cox asks what happens for any n, and the answer takes the reader through three centuries of number theory.

The book starts with Fermat, Euler, Lagrange, Legendre and Gauss, using only elementary methods. Then it turns to the ideas that the general question forced into existence: the theory of quadratic forms, algebraic number fields, class field theory and, at the end, complex multiplication and elliptic curves. Because everything grows from one concrete question, abstract machinery that seems arbitrary elsewhere feels necessary here. It is demanding but very rewarding, and the historical notes are first-rate.

Best forReaders who like to see a whole theory grow out of one question.

No. 16 · Step IV

Rational Points on Elliptic Curves

Joseph H. Silverman and John Tate · Springer · 1992

Elliptic curves are the curves defined by cubic equations such as y² = x³ + ax + b, and they sit at the centre of modern number theory. They were the key to Wiles's proof of Fermat's Last Theorem, and they are used in the cryptography of every phone. Most books about them assume years of preparation. This one does not.

It grew out of lectures John Tate gave to undergraduates in 1961, written up and expanded by Joseph Silverman, who also wrote number five. Using little more than algebra and a bit of geometry, it explains how points on such a curve can be added, proves Mordell's theorem that the rational points are generated by finitely many of them, and touches on integer points, finite fields and complex multiplication. Tate later won the Abel Prize. It is the friendliest door into one of the deepest subjects in mathematics.

Best forUndergraduates who want to see the objects behind the proof of Fermat's Last Theorem.

No. 17 · Step IV

Multiplicative Number Theory

Harold Davenport, revised by Hugh L. Montgomery · 1967, third edition 2000

The books above are mostly algebraic. This one is the classic introduction to the other half of the subject, analytic number theory, in which questions about the primes are answered with the tools of calculus and complex analysis. It is where The Music of the Primes becomes mathematics.

Harold Davenport, a Cambridge mathematician, built the book from lectures, and it reads that way. Each short chapter covers one step: Dirichlet's theorem on primes in progressions, the prime number theorem, the zeros of the zeta function and of its relatives, and on to the large sieve and the theorem of Bombieri and Vinogradov. The third edition was revised by Hugh Montgomery. It is terse and exacting, and for anyone who wants to understand what the Riemann hypothesis actually says, there is no better guide.

Best forReaders with complex analysis who want to understand how the primes are distributed.

Step V · Books 18–21

History and the sources

Four books on where number theory came from, ending with the book that founded it as a modern subject.

No. 18 · Step V

Number Theory and Its History

Øystein Ore · 1948, Dover edition 1988

Øystein Ore was a Norwegian mathematician who taught at Yale, and his book is a gentle textbook in which the history is not decoration but the structure. Each topic is introduced through the people who first asked about it, starting with counting systems and the earliest known tables of numbers and moving through Euclid, Diophantus, Fermat and Euler to Gauss.

The mathematics is elementary and carefully explained, with exercises, so it can be used as a first course, and the stories make it far easier to remember than most textbooks. It covers primes, divisors, perfect and amicable numbers, congruences, Diophantine equations and the classical theorems. The Dover edition costs very little. For the wider story it belongs to, see the best history of mathematics books.

Best forBeginners who like to know who discovered what, and why.

No. 19 · Step V

Number Theory: An Approach Through History from Hammurapi to Legendre

André Weil · Birkhäuser · 1984

André Weil was one of the founders of modern number theory and algebraic geometry, and late in his life he turned historian. This book is his account of the subject's first great age, centred on four men, Fermat, Euler, Lagrange and Legendre, and on what each of them actually knew and proved.

It is history written by a mathematician for mathematicians. Weil restates the old arguments in modern terms, shows what was implicit in them, and is not shy about judging who understood what. A short opening chapter goes back to the earliest records of arithmetic. You need to know some number theory to follow it, but if you do, it is an extraordinary experience to watch a modern master read Fermat's letters and Euler's papers over the original authors' shoulders.

Best forMathematicians who want history written by one of the masters of the subject.

No. 20 · Step V

The Little Book of Bigger Primes

Paulo Ribenboim · Springer · 1991, second edition 2004

Paulo Ribenboim, who taught for many years at Queen's University in Canada, spent much of his career gathering everything known about prime numbers into books, and this is the most approachable of them. It is organised around a handful of questions. How many primes are there? How can you tell whether a number is prime? Is there a formula that produces them? How are they distributed? And what are the largest ones known?

For each question Ribenboim gives the history, the main theorems with sketches of proofs, and the records, with tables of special primes such as Mersenne primes, twin primes and primes in arithmetic progression. Records have moved on since the second edition, but the book remains the best map of the subject. It is the place to look up a fact about primes, and it is surprisingly easy to read through.

Best forPrime collectors, record hunters and anyone who likes tables of numbers.

No. 21 · Step V

Disquisitiones Arithmeticae

Carl Friedrich Gauss, translated by Arthur A. Clarke · 1801, English edition 1966

Gauss published this book in 1801, when he was twenty-four, and it turned a scattered collection of results into a unified subject. It is where the congruence notation a ≡ b (mod n) first appears, where the first complete proof of the law of quadratic reciprocity was published, and where the theory of quadratic forms was developed in depth. Its final section explains which regular polygons can be constructed with a ruler and compass, including the seventeen-sided one Gauss discovered as a teenager.

Reading it is hard work, because Gauss polished away every trace of how he found his results, which is why his contemporaries struggled with it too. But even a few pages show you a mind of a rare kind, and much of number theory over the following century consisted of understanding what Gauss had done. For the man himself, see his biography.

Best forAnyone who wants to read the founding text of the subject in Gauss's own words.

After the shelf

What to read next

If one number has caught your imagination, there is probably a whole book about it in books about a single number, and if one problem has, in mathematics books dedicated to a single problem. For the primes as pictures and curiosities, there is my page of interesting prime numbers.

The people in these books, Gauss, Hardy and the rest, have their lives told in the best biographies of mathematicians. And the road beyond number theory, into algebra, analysis and geometry, is laid out in how to learn mathematics and in the self-learner's roadmap.