Announcements

Getting in touch with your instructor...

Useful Resources

LaTeX Fun

You can exchange the commands in the box below for your own and render it on demand. It's kind of fun! Press the Render! button when you're ready.

Let’s roll that beautiful math footage!

\({}\)

SageMath and Tiny SageMath Programs

SageMath is free open source mathematics software that can do some pretty amazing calculations, and the software has a ton of useful libraries and built-in functions. You can download and install Sage for use on your computer through a terminal window or Juypter notebook, or you can use Sage online through CoCalc or SageMathCell. The SageMath language is built on Python, so if you know a bit of Python then you can often logic your way around SageMath. I will often use SageMathCell in class for quick examples and calculations but I prefer to use SageMath in a Juypter notebook on my computer so you might see both during the class meetings.

For really quick things, here's a SageCell box that you can try out! Change the input area to be whatever code you need, press Evaluate, and ta da!

You may prefer a different language or different software and that's great! Go ahead and use whatever you wish that will complete the same operations. SageMath has a lot of built-in programs and functions that make the programming easier, but there's something to be said for figuring out how to get the same results yourself and for learning how to do the same computations in your preferred programming language.

A few good SageMath commands to know:

  • mod(x,n) returns the remainder of \(x\) modulo \(n\)
  • factor(n) factors \(n\) ... but this can time out if \(n\) is big and hard enough to factor
  • inverse_mod(x,n) calculates the inverse of \(x\) modulo \(n\)
  • power_mod(x,i,n) gives \(x^i\) modulo \(n\)
  • euler_phi(n) produces \(\varphi(n)\), the Euler totient of \(n\)
  • g=mod(primitive_root(p),p) instructs Sage to select a primitive root modulo \(p\) and call it \(g\)
  • p= random_prime(a, True) will return a random prime between 2 and \(a\)
  • CRT_list([a1,a2,...,ak],[m1,m2,...,mk]) will solve a system of linear congruences, \(\{x \equiv a_1 \textrm{ mod } m_i \mid 1 \leq i \leq k\}\), provided that the moduli are pairwise relatively prime
  • Mod(x,p).nth_root(n,all=True) asks Sage to produce a list of all remainders modulo \(p\) that, when squared, produce \(x\)
  • Mod(x,p).sqrt(all=True) asks for all square roots of \(x\) modulo \(p\)