Recognising a good idea when he sees one, William Stein has put the source code to his Springer-published undergraduate textbook Elementary Number Theory: Primes, Congruences, and Secrets: A Computational Approach on GitHub.
The book introduces classical elementary number theory and elliptic curves, with lots of Sage code to encourage you to play around with the structures involved. If you want a physical copy, you can still get one from Springer-Verlag for £29.99.
If you don’t already know Stein, he’s the director of the Sage project to create a viable open source alternative to software such as Mathematica and Maple. At the moment he’s working on cloud.sagemath.com, a browser-based Sage environment hosted in the cloud. I think it’s pretty good!
Get the source code: Elementary Number Theory: Primes, Congruences, and Secrets on GitHub.
Announced by William Stein on Google+.