Examples
Notebooks, boards and LaTeX documents, each shown as it renders: read them here, then download one and open it in Sagebrush to run and change it. All are MIT licensed.
Notebooks
- Generators & classes
Generators, a vector class with operators, and coroutines driven by hand.
programming - A notebook with its own helper code
A notebook that imports its longer functions from _code/helpers.py beside it, and reads a data file: a document is a folder.
programmingnumber theorysagebrush - A notebook that hides its setup
Continued fractions of the square root of 2 and of pi, with the setup code hidden and a long check's output hidden (Jupyter's own flags).
number theoryprogramming - Magma
Magma programs: sequences, functions and procedures, polynomials.
basicsprogramming - MATLAB
MATLAB programs: matrices, linear algebra and functions defined in a cell.
basicslinear algebra - matplotlib
Line plots, histograms, bar charts and an animation with matplotlib.
plotsdata - Number theory
The extended Euclidean algorithm, Fermat numbers, RSA in a few lines and Pell's equation, in plain Python.
number theory - numpy
Arrays, seeded random streams, eigenvalues and least squares with numpy.
linear algebradata - Algebraic number theory (Sage)
Number fields: discriminants, maximal orders, units, regulators and how primes split.
number theoryalgebra - Calculus (Sage)
Symbolic expressions, derivatives, limits, integrals, series and differential equations.
calculus - Sage
Sage mode: ^ is a power, division is exact; harmonic numbers, factoring and primes.
basicsnumber theory - Galois groups (Sage)
Galois groups of polynomials over the rationals, and how the descent found them.
group theorypolynomialsnumber theory - Gröbner bases (Sage)
Multivariate polynomials: products, gcds, factoring and Gröbner bases.
polynomialsalgebra - Group theory (Sage)
Permutation groups: orders, products, cycle types and the Mathieu groups.
group theory - Modular forms (Sage)
Modular symbols, Hecke polynomials, spaces with a character and dimensions of cusp forms.
modular formsnumber theory - Plots (Sage)
Plots that add up, points and labels, and interacts with sliders.
plotsinteractive - Polynomials (Sage)
Factoring over ZZ and QQ, cyclotomic and Swinnerton-Dyer polynomials, roots and gcds.
polynomialsalgebra - Text & data
Regular expressions, JSON, counting and sorting words.
dataprogramming - Welcome
Python 3.14 in the page: exact big integers, fractions, a prime sieve and Markdown cells.
basicsprogramming
Boards
- Calculus in Sage
Sage code items: a derivative, integrals, a Taylor polynomial, a limit, a series, an ODE, and a plot of cos x against its Taylor polynomial.
calculus - The Collatz map, live
Python code items, run reactively in reading order, with their output under their code.
number theoryprogramming - Hello, board: every kind of item
Every kind of item: notes in many shapes, Markdown and math, a group, a sticker, ink, and Python code items that run.
basics - How Sagebrush is built
The architecture, with a tour: where it runs, the notebook, the compiler, the runtime, the library and the engines.
sagebrushdiagrams - Three proofs that there are infinitely many primes
Euclid, Euler and Fürstenberg, a page each, with tours: pages, math, and printing (or saving as PDF) a sheet per page or per step.
number theoryproofs - Linear algebra with NumPy
NumPy code items: solving a linear system, eigenvalues and a least-squares fit.
linear algebra - Magma
Magma code items: factoring, prime sequences, Euler's phi and the Chinese remainder theorem.
basics - MATLAB
MATLAB code items: a determinant, eigenvectors, a linear solve, polyfit, a loop, a function and a plot.
basicslinear algebra - Mermaid flowcharts, laid out by the board
Two Mermaid flowcharts laid out by the board: every shape and kind of line, and about 100 nodes of Mermaid's own code flow.
diagrams - Museum tour: how do you solve polynomial equations? (after Bianca Viray)
A tour in rooms: solving polynomial equations by Newton's method, number fields, Galois groups and rational points.
polynomialsnumber theory - Number theory in Sage
Sage code items: primes, a Fermat number factored, the Chinese remainder theorem, and arithmetic functions.
number theory - Plots with matplotlib
matplotlib code items: a line plot, a histogram, a scatter plot and side-by-side bar charts.
plots - How do you solve polynomial equations over Q? A museum tour
Rational roots, Galois groups, rational points on a circle and on an elliptic curve, in Sage code items.
polynomialsnumber theory - What does transitive mean?
A Sage lesson on permutation groups: orbits, orbit-stabilizer, blocks, with questions that check answers.
group theoryteaching
LaTeX documents
- Article
Sections, equations, theorems and proofs, cross-references, a table of contents
writingproofs - Beamer talk
Slides: overlays, columns, a math slide
slides - Bibliography
Citations and a reference list (and a .bib file)
bibliographywriting - CV
A one-page curriculum vitae
writing - Figure with an image
graphicx, a caption and a reference to the figure
figureswriting - Homework or exam
Numbered problems with points
teachingwriting - MATLAB code
A MATLAB listing, with the math it computes
writing - PythonTeX
Python in the document (pycode, \py)
writing - SageTeX
Sage computations in the document (\sage, sagesilent, \sageplot)
writing - A paper with its own helper code
SageTeX whose code imports helper.py beside the .tex: Pell's equation for 61 and the longest Collatz run below 1000. A document is a folder.
writingnumber theorysagebrush - TikZ and pgfplots
A plot and a drawing
figuresplots