A Python library for nerdy mathematical functions and number theory.
Project description
numnerd 🤓
numnerd is a Python library dedicated to the pursuit of numerical excellence and the exploration of integer properties. The library currently features exactly 73 specialized functions, providing a comprehensive toolkit for the modern number theorist.
Whether you are seeking the next Mersenne prime, navigating the recursive paths of the Collatz conjecture, or calculating $\pi$ to a precision that would make a circle blush, numnerd provides the necessary tools.
🛠 Installation
You can install numnerd via pip:
pip install numnerd
Note: For those with a collaboration distance of zero to the source, cloning the repository is also an option.
🚀 Quick Start
Integration is straightforward. No complex axioms required.
from numnerd import is_prime, fibonacci, calculate_pi, is_happy_number
# Primality check
is_prime(17) # True
# The 10th term of the Fibonacci sequence
fibonacci(10) # 55
# Detecting "Happy" integers
is_happy_number(19) # True
# High-precision constants
calculate_pi(50)
📚 The Collection
Organized into four fundamental modules, the library provides a comprehensive toolkit for mathematical discovery.
🔢 Building Blocks (primes)
Tools for the analysis of primality and divisibility.
- Classification:
is_prime,is_perfect_number,is_sophie_germain_prime,is_twin_prime,is_mersenne_prime,is_chen_prime,is_fermat_prime. - Arithmetic Functions:
prime_factorization,euler_totient($\phi$),mobius_function($\mu$),prime_pi($\pi(n)$). - Search & Selection:
sieve_of_eratosthenes,lcm,next_prime,prev_prime. - Conjectures:
goldbach_partition.
🌀 Recursive Logic (sequences)
Exotic and classical integer sequences.
- Foundations:
fibonacci,lucas_number,catalan_number,triangular_number,pell_number,collatz_path. - Growth & Patterns:
look_and_say,lazy_caterer,thue_morse_iteration,recaman_sequence,padovan_sequence,sylvester_sequence. - Combinatorial:
bell_number,motzkin_number,juggler_sequence,golomb_sequence,perrin_number,narayana_cows. - Chaotic Systems:
hofstadter_q,van_eck_sequence,wythoff_sequences.
🃏 Numerical Oddities (recreational)
Properties that emerge from the digits themselves.
- Self-Referential:
is_armstrong_number,is_munchausen_number,is_disarium_number,is_neon_number,is_kaprekar_number,is_automorphic_number. - Digit Dynamics:
kaprekar_routine(6174),digital_root,is_spy_number,is_keith_number,is_vampire_number,is_polydivisible_number. - Divisor Relations:
is_abundant_number,is_deficient_number,is_smith_number,is_pronic_number,is_happy_number.
♾️ Fundamental Constants (constants)
Arbitrary-precision calculation of the universe's most important ratios.
- Universal Ratios:
calculate_pi,calculate_e,calculate_golden_ratio,calculate_silver_ratio. - Roots & Logarithms:
calculate_sqrt2,calculate_ln2,calculate_gauss_constant. - Physical & Mathematical Limits:
calculate_catalan_constant,calculate_universal_parabolic_constant,calculate_aperys_constant,calculate_gelfond_constant,calculate_omega_constant,calculate_levy_constant.
🧪 Verification
We value rigor. The library maintains a 1:1 ratio of functions to tests.
python run_tests.py
📜 License
This project is licensed under the MIT License. As Paul Erdős would say, "A mathematician is a device for turning coffee into theorems"—this library is simply the byproduct of that process.
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty." – Bertrand Russell
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numnerd-0.0.2.tar.gz.
File metadata
- Download URL: numnerd-0.0.2.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79af606e24975bc269d6e8851f77e204cb2f2a94035b0b526a9352fc0eaf0b54
|
|
| MD5 |
bca4666d470a1987575789015191b47b
|
|
| BLAKE2b-256 |
9e6d522ebaa7b17020daf75a04a2c299fc56369d26180a25e1266375316d8d3c
|
Provenance
The following attestation bundles were made for numnerd-0.0.2.tar.gz:
Publisher:
publish.yml on mduckwitz/numnerd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numnerd-0.0.2.tar.gz -
Subject digest:
79af606e24975bc269d6e8851f77e204cb2f2a94035b0b526a9352fc0eaf0b54 - Sigstore transparency entry: 813215581
- Sigstore integration time:
-
Permalink:
mduckwitz/numnerd@6650e28b9919958a608531b265982968910db7c7 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/mduckwitz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6650e28b9919958a608531b265982968910db7c7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file numnerd-0.0.2-py3-none-any.whl.
File metadata
- Download URL: numnerd-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee8dd251439fc99a0f88f9942da7536594cabd82b76c96da3439bb1c2fd290b6
|
|
| MD5 |
c2fe8a74ad15aee1cfa8216c0793132a
|
|
| BLAKE2b-256 |
070c36d69fae82dd9fa43c97f890dc0c1a7e78008d12f9a1e61f90f141752438
|
Provenance
The following attestation bundles were made for numnerd-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on mduckwitz/numnerd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numnerd-0.0.2-py3-none-any.whl -
Subject digest:
ee8dd251439fc99a0f88f9942da7536594cabd82b76c96da3439bb1c2fd290b6 - Sigstore transparency entry: 813215585
- Sigstore integration time:
-
Permalink:
mduckwitz/numnerd@6650e28b9919958a608531b265982968910db7c7 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/mduckwitz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6650e28b9919958a608531b265982968910db7c7 -
Trigger Event:
push
-
Statement type: