10
$\begingroup$

Sometimes students will contact me, as my email is visible. This time, an undergraduate in Sri Lanka has no number theory courses available and is self studying.

My own experience is that it helps to run computer experiments; that is how i learned the topic. I took a course in C++ some twenty years ago, and that has served me well. Steep learning curve, though. It helped a good deal when I found I could use the GMP library for large integers. My impression is that many current computer languages have large integers built in.

What computer languages might one recommend for, say, investigations in number theory?

As far as books, she is currently reading Burton. I have requested that and Burn, A Pathway into Number Theory, from my library. The one thing i would add to early number theory is quadratic forms, maybe just binary, before attempting quadratic fields. I like that Burns does the automorphism group of a binary quadratic form; he may not call it a group, not sure yet.

Recommendations for inquiry based/aided discovery textbooks

$\endgroup$
  • $\begingroup$ I have said it many times. Just in case I haven't said it to you: I totally enjoyed Joe Robert's Elementary number theory - a problem oriented approach when I was an advanced high schooler. No theorems, just definitions and exercises that cover proofs broken into smaller parts (as well as examples). Of course, one could also do wonders with a suitable CAS and material prepared for that. Roberts book is pre-computer era, so may not be exactly what you need. $\endgroup$ – Jyrki Lahtonen Feb 27 '17 at 18:17
  • $\begingroup$ @JyrkiLahtonen new one on me, looks good. I was able to download from archive.org/details/ElementaryNumberTheory_841 $\endgroup$ – Will Jagy Feb 27 '17 at 18:43
  • $\begingroup$ I'm not sure what you're trying to ask. You're unclear what your question is. Are you asking for a recommendation on how to self study number theory? $\endgroup$ – Timothy Jan 17 at 0:56
  • $\begingroup$ @Timothy I suppose I was at the time. Note that Jyrki, for example, knows me well from MSE and has a pretty good idea what I might be hoping this student would study. $\endgroup$ – Will Jagy Jan 17 at 1:04
10
$\begingroup$

I would recommend Python combined with SageMath, as already recommended by Joseph O'Rourke, or rather SageMath and Python comes naturally.

Python is a modern, and widely used, interpreted language (no compilation needed) it supports big integers via the bignum type. (But using SageMath I think this is tangential, I mention it for completeness mainly.)

SageMath is a free CAS whose user language is essentially Python. SageMath has lots of number theory functionality; its founder William A. Stein is a number theorist.

He also wrote a nice book "Elementary Number Theory: Primes, Congruences, and Secrets" that uses this software; you can check it out on his site.

As you mentioned PARI/gp you might be interested to know that PARI is an integral part of SageMath.

$\endgroup$
  • 1
    $\begingroup$ Yes, I get a good deal of mileage out of pari, although I still do not know how to write multi-line programs in pari. I do know how to do big programs in Magma, but the language developed some strange storage problems at the msri installation and I could no longer run a program for months at a time. Naturally, the people who maintain Magma were unable to duplicate the problem there in Sydney. $\endgroup$ – Will Jagy Jan 21 '17 at 0:07
  • 2
    $\begingroup$ @pjs36 this is the book page wstein.org/ent $\endgroup$ – Will Jagy Jan 21 '17 at 0:12
  • $\begingroup$ @pjs36 yes, it was an error, I meant to link to the page Will Jagy gives. It's fixed now. $\endgroup$ – quid Jan 21 '17 at 0:37
  • 1
    $\begingroup$ @WillJagy the original idea behind SageMath was to have a substitute for Magma. So if you know Magma lots of things in Sage should be familiar. $\endgroup$ – quid Jan 21 '17 at 0:41
  • 1
    $\begingroup$ +1. While it isn't necessary for large integers, the gmp library is usable in python as gmpy and does provide good functions for next_prime, is_prime, gcd,... $\endgroup$ – Matthew Towers Jan 23 '17 at 9:03
6
$\begingroup$

What computer languages might one recommend for, say, investigations in number theory?

I find Mathematica ideal, e.g.:

But: (a) there is a huge start-up learning curve, and (b) Mathematica is not free. Because of the latter, I recommend Sage / SageMath:


MultiGraph
Multi-edge graph: "All pairs of characters in the sentence 'I am a cool multiedge graph with loops.'"


$\endgroup$
  • $\begingroup$ Hi, Joseph. Is that the same as sage? I have that at home but have never figured out how to write a many-line program. $\endgroup$ – Will Jagy Jan 20 '17 at 23:50
  • $\begingroup$ Website seem to show an online calculator version; they also show titles of books for beginners. Good start. $\endgroup$ – Will Jagy Jan 20 '17 at 23:52
  • 2
    $\begingroup$ @WillJagy likely yes, except if you are into accounting, and have that Sage. // I second the recommendation for SageMath. In fact I wrote an answer recommending it in parallel. $\endgroup$ – quid Jan 20 '17 at 23:55
  • 2
    $\begingroup$ @WillJagy The version of Sage that runs in a terminal is a bit hard for me to use (I think you save a text file with your long programs and load it, to access the functions you've defined). But they've put a lot of work into creating an online interface (SageMathCloud) and it is very nice to use (in my opinion). $\endgroup$ – pjs36 Jan 21 '17 at 0:03
4
$\begingroup$

For beginning number theory, Art of Problem Solving has an online course. The textbook used with it, Introduction to Number Theory by Matthew Crawford, can be used alone for self-study. (I have not used the course. I have used the textbook.) I tutored a very advanced 9-year-old using this book, and enjoyed it.

I see they also have an intermediate number theory course.

$\endgroup$
  • $\begingroup$ Thanks. Here is the one number theory question by this student, math.stackexchange.com/questions/2103981/… Otherwise it is mostly complex analysis. I did reply to her email, trying to get her to arrange some project with faculty there. math.stackexchange.com/users/393345/janitha357 $\endgroup$ – Will Jagy Jan 24 '17 at 19:53
  • $\begingroup$ That's above my head (for now). $\endgroup$ – Sue VanHattum Jan 24 '17 at 19:55
  • 1
    $\begingroup$ I try to show them Pascal's triangle when possible. Lots of these students on MSE try to argue purely formally, never really get their hands dirty. The worst thing is that they don't draw graphs...I put a website where they can download a pdf of graph paper, print that out, actually draw $y = 2 x^2 + x + 3$ or whatever. they never do. $\endgroup$ – Will Jagy Jan 24 '17 at 19:59
3
$\begingroup$

Seconding/complementing other answers: Python (and/or Python as a part of Sage) has a command-line interface (on Linux/Unix and on Mac OS) that does allow defining variables, pre-loading files that set things up, and so on. Python (and, thus, Sage) has built-in large integers that are easier to use than C++ large integers (in my opinion). And freely available.

EDIT: ... and (I forgot to mention) it is quite easy to use the built-in graphing and graphical capabilities of Sage (especially in the "notebook" mode).

$\endgroup$
  • $\begingroup$ Right. The GMP interface for C++ still requires knowing odd looking constructions rather than simple operator overloading. I have mostly worked out what I need. I did want to offer the student something that she might actually do, but that may be too optimistic. $\endgroup$ – Will Jagy Jan 24 '17 at 19:57
  • 2
    $\begingroup$ @WillJagy, and, in my experience, the weak typing of Python/Sage is less oppressive/confusing to inexperienced students than the typing in C++. Beginners often are unable to use/see the benefits of any typing and/or pre-declaring variables, etc. $\endgroup$ – paul garrett Jan 24 '17 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.