From faa58bb4dc0791e4cbc727fe2c0969c4ccb2ad47 Mon Sep 17 00:00:00 2001 From: filifa Date: Sun, 16 Nov 2025 22:37:31 -0500 Subject: [PATCH] add readme --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..63cc7fb --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# mathtools +mathtools is a program for computing various mathematical results that would be +tedious to compute by hand. + +## Why? +Obviously, libraries, software packages, and websites exist for these sort of +calculations, but there are tradeoffs with any approach. Rather than needing to +write a script, use a REPL, or load a webpage, this allows for an approach more +like standard CLI utilities such as [GNU +factor](https://www.gnu.org/software/coreutils/factor). + +Generally, I've opted to implement routines for problems that are best solved +with *algorithms*, rather than *formulas*. For instance, the quadratic formula, +while useful, is basically plug and chug, and thus isn't implemented here. On +the other hand, determining whether a number is prime is a little more tedious +to do by hand, so it's provided as a routine. + +## Available routines +Available routines include: +* convergents of a periodic continued fraction +* solving systems of linear congruences with the Chinese remainder theorem +* discrete logarithm +* greatest common divisor +* primality testing +* Jacobi symbol +* modular inverse +* modular square root +* multiplicative order +* integer partitions +* solving Pell equations +* primitive root modulo n +* area of a simple polygon from vertex coordinates +* sieves for totient function, divisor function, Mobius function, and more +* repetend of the continued fraction of a square root +* Stirling numbers +* summatory functions