Number Theory: In Context and Interactive

Karl-Dieter Crisman's Number Theory: In Context and Interactive is a free textbook for an upper-level (US) number theory course, with a clear vision to expose students to the connections to all areas of mathematics. There are many exercises, both proof-based and computational, and nearly every concept can be visualized or experimented with using the open source mathematics software SageMath.

The book tackles all standard topics of modular arithmetic, congruences, and prime numbers, including quadratic reciprocity. In addition, there is significant coverage of various cryptographic issues, geometric connections, arithmetic functions, and basic analytic number theory, ending with a beginner's introduction to the Riemann Hypothesis. Ordinarily this should be enough material for a semester course with no prerequisites other than a proof-transition experience and vaguely remembering some calculus.

The current edition is the January 2017, or 2017/1 Edition.

http://math.gordon.edu/ntic/index.html