Skip to content

hammad93/mills-constant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mills constant

1,665,460 Digits of the mills constant. The computation is under the assumption that the Riemann hypothesis is true. Please reference original repository here, https://github.com/ZabeMath/mills-constant

Jupyter Notebook

A Jupyter notebook is included in the notebooks directory which can reproduce both the original 555,153 digits of the Mills constant and the provided 1,665,460 digits. In the directory, there are also 2 text files, A_14.txt and A_13.txt, that are the direct outputs of the notebook and represent the Mills constants computed with the 13th Mills PRP and 14th Mills PRP. They can be considered duplicates.

Mills Primes Table

A table in the notebooks directory names mills-primes.csv is provided. The table is in Comma Seperated Value (CSV) format with columns n and prime that represent the nth prime in the Mills prime sequence when 3 is the exponent utilized. To open the table in Python, we can use this code,

import pandas as pd
df = pd.read_csv('mills-primes.csv')

# Retrieve n = 15 prime
n = 15
prime = df[df["n"] == n]["prime"].iloc[0]
prime = int(prime) # convert it to an integer

Numerical Computation

This repository utilizes mpmath for numerical computation such that arbitrary precision is achieved. This covers very large numbers, in the case of generating Mills' primes, and very small numbers, in the case of the floating point numbers in Mills' constant. Significant performance improvements are found by utilizing gmpy2 and more details can be found here.

An edge case of catastrophic cancellation occurs while computing the Mills' constant. When finding the nth root of the prime, there is a consecutive number of 0's for floating point values when dealing with arbitrarily large precision. The internal representation is in binary for mpmath and when we perform a base 10 (decimal) representation, it decreases the ones place by 1 with trailing 9's in the tenths, hundredths, and so on. During the verification, this is adjusted based on mpmath documentation.

References

In no particular order,

No generative AI was utilized to create this work.

About

1,665,460 Digits of the mills constant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 100.0%