DEV Community

Cover image for Building a Python CLI that reveals 200+ number theory properties of integers
Marcel van Dinteren
Marcel van Dinteren

Posted on

Building a Python CLI that reveals 200+ number theory properties of integers

Hi everyone,

What if you could instantly see 200+ mathematical properties of any integer?

Prime, perfect, abundant — those are well known. But there are hundreds of lesser-known classifications, many buried in OEIS or scattered across number theory literature.

I wanted a way to explore these properties systematically, especially for large integers where performance becomes a real constraint. That led me to build a Python CLI tool that classifies integers into 200+ number-theory properties, with a focus on speed and extensibility.

Examples of things it can detect:

• perfect / abundant / weird numbers
• Mersenne primes and primorial numbers
• amicable, sociable and aspiring numbers (aliquot sequences)
• Carmichael numbers and other pseudoprimes
• narcissistic, Kaprekar and happy numbers
• palindromic and truncatable primes
• taxicab numbers (Hardy–Ramanujan style cube sums)
• Fibonacci, Lucas, Pell and Padovan numbers
• triangular, pentagonal and other figurate numbers
• strange curiosities like Belphegor’s prime, vampire numbers and Munchausen numbers

The current version contains 205 atomic classifiers plus 27 intersections (232 properties in total).

Example output:

Some features:

• 200+ classifiers
• extensible plugin-like architecture
• configurable profiles (fast vs heavy computations)
• OEIS sequence integration
• support for very large integers (100000 digits by default)
• explanations for each classification

The project is open source:

https://github.com/c788630/Numclass

I’m now looking for people who would like to test it, especially:

• mathematicians
• Python developers
• people interested in number theory
• anyone who likes exploring interesting integer properties

If you decide to try it out, I would really appreciate feedback on:

• usability of the CLI
• additional number-theory properties to implement
• performance for very large numbers
• any issues or bugs you encounter

There are also a few small Easter eggs hidden in the program (including Klingon number input), so feel free to explore 🙂

Installation instructions and documentation are available in the repository (docs folder).

Top comments (0)