## Preface To the Instructor

Assuming that the reader of this preface is an instructor of an actual course, may I first say thank you for introducing your students to number theory! Secondly of course I’m grateful for your at least briefly considering this text.

In that case, gentle reader, you may be asking yourself, “Why on earth yet another undergraduate number theory text?” Surely all of these topics have been covered in many excellent texts? (See the preface To Everyone for a brief topic list, and the Table of Contents for a more detailed one.) And surely there is online content, interactive content, and all the many topics here in other places? Why go to the trouble to write another book, and then to share it? These are excellent questions I have grappled with myself for the past decade.

There are two big reasons for this project. The first is reminiscent of Tertullian’s old quote about Athens and Jerusalem; what has arithmetic to do with geometry? (Or calculus, or combinatorics, or anything?) At least in the United States, away from the most highly selective institutions (and in my own experience, there as well), undergraduate mathematics can come across as separate topics connected by some common

*logical*threads, and being at least vaguely about ‘number’ or ‘magnitude’, but not necessarily part of a*unified whole*.When I first taught this course, I was dismayed at how few texts really fully tackled the geometry, algebra, and analysis inherent in number theory. Many do one or two (especially algebra, since number theory might often be a second course in abstract algebra), but few attacked all connections. Still, there are some which do, and I even found Elementary Number Theory by Jones and Jones [E.2.1] which does a very good job of this, though at a slightly higher level of sophistication than I found my students ready for. Those familiar with it will find that my presentation of certain topics (e.g. arithmetic functions, the zeta function) and some topic order is influenced by it; for certain proofs (especially in Dirichlet series) the proofs there and in [E.4.6] are the only ones I could find! I try to point out all such cases, and I have substantively modified even those in ways more appropriate for typical US undergraduates, as well as with somewhat different emphases.

Given my first goal, I would have happily used that text with some extra details for my students, were it not for the magic and wonder of the internet. How could I not harness this to have my students do approximations to the size of computations that their browsers are constantly doing as they go shopping on the web? Having found Sage

^{ 12 }, I found it hard to avoid using it whenever I could, and encouraging students to do the same to explore things like Euler’s \(\phi\) function (as I encourage yours to do in Section 9.2 by hand).Interactivity and visualization is becoming common currency in mathematics education. In calculus and lower-level courses this has been true for some time, but even in abstract algebra there are books like Nathan Carter’s Visual Group Theory [E.6.2], specialized software projects like PascGalois

^{ 13 }, and many general applets (including ones from the Wolfram Demonstrations or Maple Möbius projects). This has been coming into number theory too, naturally, beyond the programming projects many books have included. An early number theory text involving explicit programs (and a CD-ROM!) written for extensive course work was [E.4.7], and the first book invoking extensive use of Sage commands was probably the founder’s own [E.2.3]. Very recently (in fact, after the unofficial release of this text) the book [E.2.10] (which has similar content and aims to the current work, though at a somewhat higher level) appeared in second edition with complete SageMath worksheets on its website^{ 14 }, which can be used on CoCalc^{ 15 }(or on a local Docker version of CoCalc^{ 16 }). Hence the time is more than right for a fully online resource.So my second goal for this book is to bring online interactivity into a mainstream number theory text. It is wonderful to see students with an interest in the arts respond to the dynamic visualization in Sage interacts, while those with interests in computer science love to ask questions about how to view the source code or some of the details of representing large numbers. And all the students have access to computations from simple ones involving the aliquot parts function to the full Riemann formula for the prime number function.

Why should you

*not*use this book? First, I make few claims to topical or mathematical originality^{ 17 }. The ordering is somewhat different than usual, I include a few topics I haven’t seen addressed adequately very often in truly introductory texts (notably a beginning of the geometry of numbers and long-term averages of arithmetic functions), and I have created many visualization and exploration oriented applets.At the low end of other reasons you might not use it, some topics of great importance which are perfect for beginners (especially partitions and continued fractions) are absent. You can’t cover

*everything*in a semester, after all, and I have shied away a bit from more purely combinatorial stuff, though I hope to steadily add slightly more in successive editions^{ 18 }. At the high end of preparation, I do not and cannot expect a course in abstract algebra or complex (or even real) analysis for my students, and so this book reflects that reality. Knowing about proofs by induction and contradiction, as well as basics of sets, integers, and relations, is what I can assume. In fact, I have great recommendations for you if you know all your students can do contour integration or are ready to define a number field – see References and Further Resources. Finally, I don’t have a corporation behind me.On the other hand, I think you

*should*consider using it. This is class-tested material for standard topics (plenty for a semester-long course at most institutions), and not beholden to any interests beyond being a good resource for instructors in ‘mainstream’ undergraduate math programs in the United States. There are plenty of exercises (though not a surfeit, so feel free to supplement), fun links, and hopefully a quirky and engaging sense of wonder and exploration. The price is also right. Finally, I don’t have a corporation behind me.Should you choose to use this text, I have only a few recommendations for how to use it (see also my notes To the Student).

- Encourage in-class exploration. Put away books, turn off the computers, and just try stuff out. Create your own worksheet to explore (say) the Möbius function or solutions to linear Diophantine equations. In short, make sure your students see mathematics as a dynamic enterprise – particularly because so many of the theorems involved are highly abstract.
- Less is more. I will often pick
*one*representative proof in a section, project it on the screen, and then really follow it through on an adjacent blackboard with specific numbers (such as \(p=13\text{,}\) which is just big enough to be interesting but not so big as to be overwhelming). - Use computer examples judiciously. Sage (or any other system) can just as easily become a Delphic oracle (pun intended) spewing forth cryptic utterances as a useful tool to help create and solve conjectures. You’re possibly doing your students a disservice if you don’t use it at all, but despite having written this text with Sage in mind throughout, I don’t regard its use as completely essential. Number theory in this form has been around since Euclid, so the past thirty years of mass-market computation is a drop in the bucket of time. If you want a true inquiry-based approach, I like the text Number Theory through Inquiry [E.2.5] a lot.
- Note the Sage notes (full list at the List of Sage notes). Especially if you have more than just a few students who have a little programming experience, this is a perfect course to find projects to challenge them with, such as those in the venerable [E.2.4]. The Sage notes gently remind or give short introductions to some aspects of how to use Sage and Python
^{ 19 }(the language Sage is based on). They are not formally structured or arranged, or comprehensive; if you are looking for this, you should supplement your course with a real basic programming text in Python, such as [E.3.7] or [E.3.8]. (The already-initiated should note that as of January 2020 this book has been updated to Sage 9 and Python 3, so some commands, especially those involving`print()`

, may not work with certain earlier versions of Sage.) - Use the exercises, and ones outside the book if you want. There are exercises for each chapter, of varying difficulty levels (in the grand tradition of upper-level math texts, I do
*not*provide solutions). In general, assigning daily, collecting weekly seems to be a decent model – though be sure to give students ample warning as to*which*ones will be collected! The last few chapters’ material is more advanced, and there are correspondingly fewer possible exercises. I find this to be a good time for a small project in the history of number theory; especially if you have students from several different cultural heritages, having them discover where it comes up in theirs (it nearly always does) has been a perennial favorite.

There are no sections marked as optional, or table of dependencies, though these should be pretty similar to most elementary texts. (I do pretty much everything in my own course, picking results or sections to skip on the fly if time or the students seem to require this.) Here are some minor suggestions, though.

- If you are teaching a shorter course or wish to spend more time on some topic, the chapters on Beyond Sums of Squares and More on Prime Numbers are certainly optional in this sense.
- The chapters concerning Points on Curves and Long-Term Function Behavior are not optional in my view of number theory, but may be viewed as ‘selected topics’.
- If you don’t like cryptography or believe (like Hardy) that there are no applications to number theory, you can certainly create a nearly application-free course by skipping the chapters on An Introduction to Cryptography and Some Theory Behind Cryptography.
- I don’t consider the last several chapters on the prime counting function and other arithmetic functions connecting to calculus to be optional, but I have the luxury of having mostly juniors and seniors for a full semester. In a quarter course or one aimed more at sophomores (in the United States), one should still at the very least spend a couple days at the end of the course talking about these topics, perhaps discussing sections 21.2 and 21.3, and smatterings of Chapter 25.

As a final note, I hope you enjoy using the text as much as I’ve enjoyed teaching from it. Everyone should have that day where a student’s jaw drops from a cool theorem displayed visually, or when the students are working so intently on an in-class project that they don’t even notice the class period end. It’s been my privilege to have that happen, and my hope is this text can bring you closer to that goal.

`www.sagemath.org/`

`faculty.salisbury.edu/~despickler/pascgalois/`

`tvazzana.sites.truman.edu/introduction-to-number-theory/`

`cocalc.com`

`github.com/sagemathinc/cocalc-docker`

I have tried hard to credit any non-standard proofs which are essentially in the form I found them, as well as many of those which I have modified for my students’ needs. I appreciate forbearance (and notification!) if I have missed any such citations so that I may correct them.

See [E.2.11] for a nice introduction in a more combinatorial vein, particularly to partition identities.

`www.python.org`