As Wikipedia explains in number theory, Mills' constant is defined as:

"The smallest positive real number $A$ such that the floor function of the double exponential function $\lfloor A^{3^{n}}\rfloor$ is a prime number, for all natural numbers $n$. This constant is named after William H. Mills who proved in 1947 the existence of $A$ based on results of Guido Hoheisel and Albert Ingham on the prime gaps. Its value is unknown, but if the Riemann hypothesis is true, it is approximately $1.3063778838630806904686144926...$ (sequence A051021 in OEIS)."

In other words, $\lfloor A^{3^{n}}\rfloor$ is said to be a prime-representing function, because $f(x)$ is a prime number for all positive integral values of $x$.

The demonstration made by Mills in 1947 (pdf here) is very easy to follow (one must be careful about the already known typos of the paper to follow properly the explanation).

It is also known that generically (as explained in this nice question at MSE) $\lfloor Q^{k^{n}}\rfloor$ always works if $k$ is at least $3$, so there are other constants $Q$ not defined yet that will work when $k$ is greater than $3$. It is also known that $k=2$ might not work because it depends on the Legendre's conjecture: is there always a prime between $N^2$ and $(N+1)^2$ (thought to be extremely difficult to demonstrate).

The reason of this question is that based on the original demonstration and using the Bertrand's postulate as key for some manipulations, I tried to do my own version of the Mill's constant to learn, and it seems that was able to find a constant $L$ that for $\lfloor L^{2^{n}}\rfloor$ provides a sequence of integers associated to their next prime, so it is possible to calculate the associated sequence primes by a prime-representing function. The difference of this approach is that the sequence of integers obtained from $\lfloor L^{2^{n}} \rfloor$ are not primes directly, it is an integer sequence, but there is an associated sequence of primes obtained from them. Here is how it works (the questions are at the end of the explanation):

According to Bertrand's postulate for a given integer (let also suppose for the demonstration that it is prime) $p_i$ it holds:

$p_i < p_j < 2p_i$ for some existing prime $p_j$

Now adding $+p_i^2+1$ in the inequalities:

$p_i+p_i^2+1 < p_j+p_i^2+1 < 2p_i+p_i^2+1$

Which is also true if in the left side we just leave $p_i^2$:

$p_i^2 < p_j+p_i^2+1 < (p_i+1)^2$

Calling $e_j = p_j+p_i^2+1$ it is possible to build (from here I will use the same steps as in Mill's paper) a sequence of integers $E_1, E_2,...E_n$ such as:


$E_1^2 < E_2 < (E_1+1)^2$

$E_2^2 < E_3 < (E_2+1)^2$


$E_{n-1}^2 < E_n < (E_{n-1}+1)^2$


The same conditions for the sequence shown in Mill's demonstration would hold for this expression, and in this case the exponent is $2$ instead of $3$ but we do not depend on Legendre's conjecture because the associated prime $P_n$ to $E_n$ is a Bertrand's prime (so it exists always in the interval $[E_n,2E_n]$). In other words, it is possible to use the power of $2$ because the sequence is not directly a sequence of primes, but a sequence of integers attached to primes by Bertrand's postulate according to the manipulation:

$P_n = E_n-E_{n-1}^2-1$

And in the same fashion as Mill's constant:

$E_n=\lfloor L^{2^{n}} \rfloor$

Where L is obtained after some manual calculations (up to $n=11$) as


The way of manually calculating the constant is as follows, in the same fashion that Mill's demonstration, the relationship between $L_n$ (the constant calculated after knowing the $n^{th}$ element of the sequence $E_n$) and $E_n$ is:


These are the calculations for the first $5$ elements:

For instance for $n=1..5$, $\lfloor L^{2^{n}} \rfloor$ is:


$E_2=8$ and $P_1=E_2-(E_1)^2-1=8-2^2-1=3$

$E_3=76$ and $P_2=E_3-(E_2)^2-1=76-8^2-1=76-64-1=11$

$E_4=5856$ and $P_3=E_4-(E_3)^2-1=5856-76^2-1=5856-5776-1=79$

$E_5=34298594$ and $P_4=E_5-(E_4)^2-1=34298594-5856^2-1=5857$

$L$ slightly grows on every iteration but the growth is each time smaller, so it clearly tends to a fixed value when $n \to \infty$. This is the graph:

enter image description here

So in essence the prime-representing function would be:

$P_n = \lfloor L^{2^{n}} \rfloor -E_{n-1}^2-1 = \lfloor L^{2^{n}} \rfloor -(\lfloor L^{2^{n-1}} \rfloor)^2-1$ for $n \ge 2$, $P_n \in \Bbb P$.

...being the starting element of the sequence $E_1=2=P_1$ and $L$ the value of $L_n$ when $n \to \infty$.

This is the Python code to calculate and test $L$, please be free to use it or modify it:

def mb():
    from sympy import nextprime
    from gmpy2 import is_prime
    import matplotlib.pyplot as plt
    import matplotlib as mpl
    import decimal

    print("L constant test. Equivalent to Mill's constant applying Bertrand's postulate")

    # Decimal precision is required, change according to test_limit
    decimal.getcontext().prec = 2000
    # List of elements E_n generated by L^(2^(n))
    E_n = []
    # List of progressive calculations of L_n, the last one of the list is the most accurate
    # capable of calculate all the associated primes
    # List of primes obtained from L^(2^(n))-E_(n-1) associated to the Bertrand's postulate
    # depth of L: L will be able to calculate the primes L^(2^(n))-E_(n-1) for n=1 to test_limit-1
    for n in range(1,test_limit):
        if n==1:
            # E_1=2
            # E_n=(E_(n-1)^2)+1
            # Be aware that the Python list starts in index 0 and the last current element is index n-1:
            # that is why n-2 appears in the calculation below
        # Next prime greater than E_n: it will be in the interval [E_(n-1),2*E_(n-1)] (Bertrand's postulate)
        # Calculation of L_n

    print("List of Elements of L^(2^(n)) for n = 1 to " + str(test_limit-1) + ":")
    mystr = ""
    for i in E_n:

    print("List of Primes obtained from L constant: L^(2^(n))-E_(n-1)-1 for n = 1 to :" + str(test_limit-1) + ":")
    mystr = ""
    for i in P_n:

    print("List of calculations of L_n (the most accurate one is the last one) for n = 1 to :" + str(test_limit-1) + ":")
    mystr = ""
    ax = plt.gca()
    ax.set_axis_bgcolor((0, 0, 0))
    figure = plt.gcf()
    figure.set_size_inches(18, 16)
    for i in L_n:

    # Print the graph of the evolution of L_n
    # Clearly it tends to one specific value when n tend to infinity

    #Testing the constant
    print("L Accuracy Test: using the most accurate value of L will calculate the primes associated")
    print("to the constant and will compare them to the original primes used to create the constant.")
    print("If they are the same ones, the constant is able to regenerate them and the theoretical background")
    print("applied would be correct.")
    #Using the most accurate value of L available
    L = L_n[len(L_n)-1]
    print("L most accurated value is:")
    for i in range(1,test_limit):
        tester = int(L**(decimal.Decimal(2)**(decimal.Decimal(i))))
        if i==1:
            tester_prime = 2
            tester_prime = decimal.Decimal(tester) - (E_n[i-2]*E_n[i-2]) - 1
        print("Current calculated E:\t" + str(tester) + " for n = " + str(i))
        print("Original value of E:\t" +str(E_n[i-1]) +  " for n = " + str(i))
        if tester == E_n[i-1]:
            print("Current calculated prime:\t" + str(tester_prime) +  " for n = " + str(i))
            if i==1:
                print("Original value of prime:\t2 for n = " + str(i))
                print("Original value of prime:\t" + str(P_n[i-2]) + " for n = " + str(i))
            # If we arrive to this point, then the constant and the theory would not be correct
            print("ERROR L does not generate the correct original E")
    print("TEST FINISHED CORRECTLY: L generates properly the primes associated to the Bertrand's postulate")

The list of first primes is (the Python code provides the output up to $n=11$)



Initially $L=1.71979778...$ seems not have been defined before, but I am not really sure. At least I was not able to find such constant at Mill's constant-related papers on Internet, but it seems interesting.

The advantages of $L$ versus $A$ (the original Mill's constant) would be:

  1. The growth rate of the double exponential is lower due to the use of powers of $2$ instead of powers of $3$ (or more for other Mill's constant interpretations), so for the same quantity of $n$ values calculated, $L$ provides smaller primes than $A$ in less time.

  2. The use of $\lfloor L^{2^{n}} \rfloor$ would not require the validation of Legendre's conjecture because it depends on Bertrand's postulate, so the theory would hold as it is.

I would like to ask the following questions:

  1. Are the manipulations for the calculation of the elements of $\lfloor L^{2^{n}} \rfloor$ applying Bertrand's postulate correct or there is a restriction or error? (initially the heuristics show that it would be correct)

  2. Is such constant interesting? Initially seems so because it is able to use a power of $2$ growth rate (versus power of $3$ in best of cases for standard Mill's constant).

  3. If the calculations are correct, are there other manipulations that could be applied to lower even more the growth rate? Thank you!

  • 1
    $\begingroup$ But you prove something slightly different.Your sequence needs two (instead of one) calculations of a fractional part [see:"So in essence the prime-representing function would be.."].Nice job.(At least I could not see at once anything wrong) $\endgroup$ Jun 1, 2016 at 19:15
  • 1
    $\begingroup$ @KonstantinosGaitanas thank you for the feedback! yes, it is different, because it is "encapsulating" a $[N,2N]$ prime into an integer of a $[N^2,(N+1)^2]$ interval and the final formula requires the previous element to be calculated (it is kind of recursive) but the theoretical base is the same as the Mill's demonstration. The point showed here would be that a Mill's constant is able to encapsulate indirectly primes of lower intervals than $[N^3,(N+1)^3]$. I think that this kind of manipulation of the intervals might provide new ideas about the Mill's constant and similar approaches. $\endgroup$
    – iadvd
    Jun 1, 2016 at 23:47
  • 2
    $\begingroup$ But the idea is nice, and we actually get more primes with the same precision. $\endgroup$
    – Peter
    Jun 6, 2016 at 12:26
  • 1
    $\begingroup$ @iadvd I think you should give it a shot and submit your idea for publication.Collaborator?Why?It is your idea,you have wrote down your arguments in latex,it will be your paper.If you have any problems contact me at [email protected] it is correct then it should be published somewhere(Maybe American Mathematical Monthly or Journal of integer sequences would be appropriate) $\endgroup$ Jul 8, 2016 at 12:10
  • 1
    $\begingroup$ @iadvd you can publish your paper without having a PhD.Give it a shot!! $\endgroup$ Jul 8, 2016 at 18:07

1 Answer 1


It has been a long time since I wrote the above question, and I was able to gather a confirmation that the contents and calculations are correct. During the last year I tried to publish the contents as a very simple paper ($5$ pages long) in several (up to $7$ different) known journals (each one of them took from $1$ month to $4$ months to receive feedback since the paper was sent). All of them confirmed (via peer review) that the calculations are correct, but basically the general comment is that is a result that can be expected to happen, so it is not so interesting to be published.

I have learnt from the experience how to write correct papers (in American English) and how difficult is the professional world of publications. So let me say that now I can understand better the struggles of professional mathematicians to be able to publish new and interesting content (I admire you!).

I would like to share all the anonymous feedback I have received from the different peers that reviewed the paper in order to close the question. The more feedback I received the better the paper was getting in terms of completion. So for your viewing pleasure (some of them were extremely kind and useful to update the paper) and not in the same order that the paper was sent to the journals:

  • The author has a simpler theoretical foundation at the cost of less cute result. It is not a surprise that such thing can be done, and the proof is indeed very short and elementary.

  • You might consider submitting a version of your paper to Mathematics Magazine for their problems section.

  • You do not adequately survey the literature. There are many papers dealing with refinements of Mills' paper that you do not cite; for example, Matomäki, K., Prime-representing functions. Acta Math. Hungar. 128 (2010), no. 4, 307–314 already obtains a sequence with growth rate like $L^{2^n}$. And other papers, such as Baker, Roger C.The intersection of Piatetski-Shapiro sequences. Mathematika 60 (2014), no. 2, 347–362. do even better. (I reviewed and added the references, this was a very important update).

  • In principle the proof idea should work. All in all I do not find the paper illuminating enough for the () experts won't find the result surprising and non-experts won't get a clear idea of the topic from this manuscript.

  • The subject itself will be of interest to very few people - the Mills' constant itself is a function that uses the primes to construct primes, and thus does not really tell any useful or interesting things about primes (the same thing can be done with any sequence, not just the primes).

  • This is a promising project, but I am not convinced that it is successful. To be more precise, the construction in the present form is not complete. (Followed by some specific points that still were not clear in the paper and I was not able to fix properly at that moment).

Plus the classical answers:

  • I am sorry to say we will be unable to consider your manuscript for publication, because we currently have an excessively large backlog of articles awaiting publication. As a result we have been forced to drastically curtail submissions for the time being.

  • Your submission is unacceptable since the topics are too specialized.

So in general, it has been a good experience, I have found a lot of patient and kind peers, professionals that had a serious look to the paper (even if I was not a professional) and provided very useful insights and advises.

Finally I wanted to thank @Konstantinos Gaitanas the kind help and review during these months by email. Unfortunately I was not able to give a successful result to that effort in this occasion. But I hope that this experience will help other people to try again until success. Lessons learned.

  • 2
    $\begingroup$ @KonstantinosGaitanas hi! a final feedback about this, not lucky this time but it was worth. Thanks for all your help! $\endgroup$
    – iadvd
    Apr 13, 2018 at 2:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .