Metadata-Version: 2.4
Name: twosquares
Version: 0.0.2
Summary: A package for very efficiently decomposing a number n into all possible x**2 + y**2 = n solutions.
Author-email: Ryan Heard <ryanwheard@gmail.com>
License: MIT
Project-URL: Repository, https://github.com/rheard/twosquares
Keywords: math
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license
Dynamic: license-file

# twosquares
Fast, exact decompositions of integers as sums of two squares.

`twosquares` exposes two simple methods for this number-theory task:

* `decompose_prime(p)` — find the unique nonnegative pair (a, b) with a² + b² = p for p = 2 or prime p ≡ 1 (mod 4).

* `decompose_number(n)` — enumerate all nonnegative pairs (a, b) with a² + b² = n (canonical pairs only).
