Number Theory

Top 17 Number Theory Open-Source Projects

  • Math PHP

    Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra

  • Project-Euler-solutions

    Runnable code for solving Project Euler problems in Java, Python, Mathematica, Haskell. (by nayuki)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • arb

    Arb has been merged into FLINT -- use https://github.com/flintlib/flint/ instead

  • Project mention: Patriot Missile Floating point Software Problem lead to deaths 28 Americans | news.ycombinator.com | 2024-01-03

    You can instead list your criteria for good number format and look at alternatives with those lenses. Floating point is designed for a good balance between dynamic range and precision, and IEEE 754 binary formats can be seen as a FP standard particularly optimized for numerical calculation.

    There are several other FP formats. The most popular one is IEEE 754 minus subnormal numbers, followed by bfloat16, IEEE 754 decimal formats (formerly IEEE 854) and posits. Only first two have good hardware supports. The lack of subnormal number means that `a <=> b` can't be no longer rewritten to `a - b <=> 0` among others but is widely believed to be faster. (I don't fully agree, but it's indeed true for existing contemporary hardwares.) IEEE 754 decimal formats are notable for lack of normalization guarantee. Posits are, in some sense, what IEEE 754 would have been if designed today, and in fact aren't that fundamentally different from IEEE 754 in my opinion.

    Fixed-point formats share pros and cons of finitely sized integer numbers and you should have no difficulty to analyze them. In short, they offer a smaller dynamic range compared to FP, but its truncation model is much simpler to reason. In turn you will get a varying precision and out-of-bound issues.

    Rational number formats look very promising at the beginning, but they are much harder to implement efficiently. You will need a fast GCD algorithm (not Euclidean) and also have to handle out-of-bound numerators and denumerators. In fact, many rational number formats rely on arbitrary-precision integers precisely for avoiding those issues, and inherit the same set of issues---unbounded memory usage and computational overhead. Approximate rational number formats are much rarer, and I'm only aware of the Inigo Quilez's floating-bar experiment [1] in this space.

    [1] https://iquilezles.org/articles/floatingbar/

    Interval/ball/affine arithmetics and others are means to automatically approximate an error analysis. They have a good property of being never incorrect, but it is still really easy for them to throw up and give a correct but useless answer like [-inf, inf]. Also they are somewhat awkward in a typical procedural paradigm because comparisons will return a tri-state boolean (true, false, unsure). Nevertheless they are often useful when correctly used. Fredrik Johansson's Arb [2] is a good starting point in my opinion.

    [2] https://arblib.org/

    Finally you can model a number as a function that returns a successively accurate approximation. This is called the constructive or exact real number, and simultaneously most expensive and most correct. One of the most glaring problems is that an equality is not always decidable, and practical applications tend to have various heuristics to get around this fact. Amazingly enough, Android's built-in calculator is one of the most used applications that use this model [3].

    [3] https://dl.acm.org/doi/pdf/10.1145/2911981

  • primecount

    ๐Ÿš€ Fast prime counting function implementations

  • galois

    A performant NumPy extension for Galois fields and their applications (by mhostetter)

  • Hecke.jl

    Computational algebraic number theory

  • maths

    Maths includes mathematical functions not defined in the standard Go math package. (by theriault)

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • nim-stint

    Stack-based arbitrary-precision integers - Fast and portable with natural syntax for resource-restricted devices.

  • Project mention: Stint (Stack-based multiprecision integers) | news.ycombinator.com | 2023-07-03
  • collatz

    Convergence verification of the Collatz problem

  • Project mention: I have to brag to you: I gained computing resources on the third most powerful supercomputer in the world. The computing resources will be used for the computational verification of the Collatz problem. | /r/Collatz | 2023-06-01

    The OP is aware of shortcuts. Read here: https://github.com/xbarin02/collatz/blob/master/doc/ALGORITHM.md OP is confirming that iterating on each starting integer (greater than 1) results in an integer less than the starting value. OP is using sieves to greatly reduce the fraction of starting values that need to be checked. OP is using a shortcut to increase speed: k2p-1 -> k3p-1 and a precomputed powers of 3 lookup table. There are theoretically better shortcuts but they may be slower in practice since they require large lookup tables that lead to cache misses which will slow things down.

  • JSage

    Something like Sage, but for the WebAssembly and JavaScript world.

  • mod

    Modular arithmetic, promoting moduli to the type level (by Bodigrim)

  • ENT

    Elementary Number Theory for Integers in Rust (by JASory)

  • primesieve

    A collection of packages related to math, algorithms and science, in Haskell.

  • Bruhat-Tits-Tree-Visualiser

    A visualiser of the Bruhat-Tits tree over โ„šp.

  • prime-spirals

    Creates images of prime numbers in various spiral patterns.

  • factor

    Factoring integers and polynomials (by gilith)

  • exp-pairs

    Linear programming over exponent pairs

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Number Theory related posts

  • I have to brag to you: I gained computing resources on the third most powerful supercomputer in the world. The computing resources will be used for the computational verification of the Collatz problem.

    1 project | /r/Collatz | 1 Jun 2023
  • SageMath is a free open-source mathematics software system

    1 project | news.ycombinator.com | 9 May 2022
  • is this scale feasible

    1 project | /r/askmath | 6 Apr 2022
  • Tiny WASI โ€“ A tiny WASI runtime written in TypeScript

    3 projects | news.ycombinator.com | 15 Mar 2022
  • What happens when a Game Developer meets the decades-old math problem?

    1 project | /r/mathematics | 29 Jan 2022
  • Whatโ€™s everyone working on this week (2/2022)?

    15 projects | /r/rust | 10 Jan 2022
  • AIT Machine Learning Challenge

    1 project | news.ycombinator.com | 15 Apr 2021
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 6 May 2024
    Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more โ†’

Index

What are some of the best open-source Number Theory projects? This list will help you:

Project Stars
1 Math PHP 2,305
2 Project-Euler-solutions 1,839
3 arb 457
4 primecount 302
5 galois 269
6 Hecke.jl 201
7 maths 176
8 nim-stint 77
9 collatz 56
10 JSage 33
11 mod 24
12 ENT 15
13 primesieve 8
14 Bruhat-Tits-Tree-Visualiser 4
15 prime-spirals 3
16 factor 3
17 exp-pairs 3

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com