Skip to main content

A mathy Python package with utilities like LCM, triangle numbers, etc.

Project description

Pythagix

Pythagix is a lightweight Python utility library for working with number theory. It offers essential math functions like checking primes, computing triangle numbers, finding GCDs, and more — all in a fast, dependency-free package.

Installation

pip install pythagix

Features

is_prime(number) — Check if a number is prime

prime_list(numbers: list) — Return all prime numbers from a list

nth_prime(n) — Get the n-th prime number

gcd(numbers: list) — Compute the greatest common divisor of a list

is_perfect_square(n) — Check if a number is a perfect square

count_factors(n) — Count the total number of factors of a number

triangle_number(n) — Compute the n-th triangle number

Example Usage

from pythagix import is_prime, nth_prime, gcd, triangle_number

print(is_prime(13))        # True
print(nth_prime(10))       # 29
print(gcd([12, 18, 24]))   # 6
print(triangle_number(7))  # 28

About

Pythagix was built to give students, developers, and math enthusiasts a clean and simple way to explore number theory in Python. It is ideal for learning, prototyping, or educational tools.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythagix-0.1.6.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythagix-0.1.6-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pythagix-0.1.6.tar.gz.

File metadata

  • Download URL: pythagix-0.1.6.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for pythagix-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c30f5189fc83c648ce752cc2ecd8106585b6a9da7efc5987532dab9e25661fcc
MD5 e3132d86fbb544a71dcc34008baf67f8
BLAKE2b-256 136715ec74be6c62cd9c75e797a475b219ecc7aea7765812d87f856020ce1ec3

See more details on using hashes here.

File details

Details for the file pythagix-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pythagix-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for pythagix-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 94bdb7d23934d38796c6b7c67622d98c8efaa23b82fdbb1961d777aa69b0074b
MD5 73a01640a3763854ff56304a092c8805
BLAKE2b-256 0bb480af70f42d75517effd0009eecb6af6adebd0f4a39e88d381150b6536930

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page