2025-11-05 16:35:15 +01:00
2025-11-05 16:35:15 +01:00
2025-11-05 12:20:31 +01:00
2025-11-05 10:11:46 +01:00
2025-11-05 12:21:07 +01:00
2025-11-05 10:38:16 +01:00
2025-11-05 12:20:31 +01:00
2025-11-05 07:52:44 +01:00
2025-11-05 12:21:07 +01:00
2025-11-05 10:11:35 +01:00
2025-11-05 11:16:36 +01:00
2025-11-05 11:22:04 +01:00
2025-11-05 10:11:46 +01:00
2025-11-05 12:21:07 +01:00

Mathy

Mathy is a playground for experimenting with streamed arithmetic on very large integers. The core mathstream package keeps big numbers on disk and operates on them chunk by chunk, which lets you manipulate values that would be impractical to materialize in memory. Around that library live a handful of experiments, utilities, and tests that explore different ways to work with big-number data.

What's Here

  • mathstream/ Streaming big-int helpers (StreamNumber, arithmetic primitives, garbage collection utilities). See mathstream/README.md for an in-depth guide.
  • collatz_ui/ + collatz.py A curses dashboard that visualizes Collatz walks. The UI pushes work onto a background thread so the main loop can keep the interface responsive while mathstream evaluates each step.
  • pi_finder/ + find_my.py Nilakantha-based π explorer with both CLI output and a curses dashboard powered by mathstream primitives.
  • stupid.py Experimental Collatz-based encoder/decoder that maps ASCII message chunks to Collatz seeds and replays the sequence to recover the text.
  • seed_start.py Utility for seeding start.txt with huge streamed additions sourced from randomness or deterministic sequences.
  • tests/ Sample digit files used by the regression script in test.py.

Getting Started

python -m venv venv
source venv/bin/activate
pip install -e .

From there you can explore the components:

  • Run the regression checks: python test.py
  • Launch the Collatz dashboard: python collatz.py
  • Stream π digits to the terminal: python find_my.py --ui
  • Print a quick π approximation: python find_my.py --digits 200
  • Try the Collatz encoder prototype: python stupid.py
  • Seed the running total file: python seed_start.py --seed 100 --mode seq

All streamed results land in instance/log/. If you need a clean slate, call mathstream.clear_logs() or delete that directory between runs.

Experiments and Next Steps

  • Streaming workers The Collatz and π dashboards (collatz_ui/app.py, pi_finder/ui/app.py) showcase background threads feeding long-running computations into a curses UI.
  • Collatz encoding stupid.py currently encodes a message by turning ASCII blocks into integers and treating the first block as the Collatz seed. Extending this to use the full sequence (or to target specific steps) is an open avenue for exploration.
  • More tests test.py covers the primary mathstream operations. Add pytest cases or property tests under tests/ as new behaviours land.

Pull requests are welcome—especially around new streamed operations, smarter Collatz decoding strategies, and additional high-volume math experiments.

Description
No description provided
Readme 140 KiB
Languages
Python 100%