Skip to main content

FoxMath 🦊

Minimalist CLI for math & cryptography exploration.

One binary. Clean output. Zero footguns. Educational by design.

Built with curiosity — for students, tinkerers, and crypto/math enthusiasts.

Features

  • Legendre symbol
  • Euler/Hermann Machin-like π approximation
  • Elliptic curve point addition (over finite fields), including named curves (secp256k1) with on-curve result validation
  • Chinese Remainder Theorem solver (handles non-coprime moduli)
  • Continued fraction expansion and convergents
  • Challenge/quiz mode — practice problems with scoring, or a worksheet mode for self-study
  • Symlink-friendly (foxmath-legendre, foxmath-pi, foxmath-ecadd, foxmath-crt, foxmath-cf, foxmath-challenge)
  • JSON output mode

Installation

pip install foxmath

Or from source:

git clone https://github.com/Abhrankan-Chakrabarti/foxmath.git
cd foxmath
pip install -e .

Usage Examples

foxmath pi --terms 200
π ≈ 3.1415926535897932384626433832795028841971693993752  (200 terms)
foxmath legendre 5 17
Legendre (5/17) = -1
# Symlinks (optional)
foxmath-ecadd --x1 1 --y1 2 --x2 3 --y2 4 --p 17
Result point: (14, 2)
# Named curve (secp256k1) — computes 2G by default
foxmath ecadd --curve secp256k1
Result point: (89565891926547004231252920425935692360644145829622209833684329913297188986597, 12158399299693830322967808612713398636155367887041628176798871954788371653930)
  ✓ on curve
# Chinese Remainder Theorem
foxmath crt --r 2 3 2 --m 3 5 7
x ≡ 23 (mod 105)
# Continued fraction expansion + convergents
foxmath cf --num 355 --den 113
[3; 7, 16]
  3/1
  22/7
  355/113
# Challenge/quiz mode — worksheet (no prompting)
foxmath challenge --topic legendre --count 2 --seed 1 --reveal
1. Legendre symbol (10/13)
   Answer: 1
2. Legendre symbol (3/7)
   Answer: -1

Drop --reveal to answer interactively instead, with scoring at the end. --topic accepts legendre, crt, or mixed (default).

# JSON output
foxmath pi --terms 100 --json
{
  "tool": "foxmath",
  "command": "pi",
  "terms": 100,
  "approx": "3.1415926535897932384626433832795028841971693993752"
}

Why FoxMath?

Because math and cryptography are more fun when you can play with them instantly in the terminal — with the same reliability as FoxPipe and fox-vault.

Simple. Practical. Reliable.

License

MIT © Abhrankan Chakrabarti


Star if you find it useful! Issues and PRs welcome.

Metadata

Release files for foxmath 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foxmath 0.6.0
File Size Uploaded
foxmath-0.6.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foxmath 0.6.0
File Interpreter ABI Platform
foxmath-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / foxmath-0.6.0.tar.gz

Download URL foxmath-0.6.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
357f453132b8901e99aafbb60583d43639efb8ae4635bb0807520b650d18e98e
BLAKE2b-256 checksum
How to use checksums
4e0c57095f56fb3aff8afe9aa86bd2cfa61bc80a2f569b26c6f6245879300d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / foxmath-0.6.0-py3-none-any.whl

Download URL foxmath-0.6.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
934ad4cdc015ce9bc167cd0955ba3b65c8233fd178f7283c4fd288baef45f82e
BLAKE2b-256 checksum
How to use checksums
b6e974327921f1093d9fe59fabe7ef4491bd195363f4fb2c1ee6f42ba6033791
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page