Talk:Formula for primes/Archive 1

Removal of formula
I've removed this formula as it clearly doesn't do what it is claimed to, but I cannot find a reference to fix it (the lack of a reference is itself a problem). I do hope someone can supply the corrected version Robma 11:17, 14 May 2006 (UTC)


 * It doesn't? It seemed to when I tried it... — vijay 18:14, 14 May 2006 (UTC)

Using MathCad it started producing composites around the n = 27 mark. But I suspect this may be due to rounding error. Either way, I still think we need a reference for this formula (I for one would be v interested to learn more about it; it's an unusually neat result for this field). Robma 21:06, 14 May 2006 (UTC)


 * Hrm. Around that range (excluding the 2s) I get
 * n=22 => 23
 * n=28 => 29
 * n=30 => 31
 * n=36 => 37
 * n=40 => 41
 * I used Java ('cause it's what I have), and of course, I used ints at first, which led to an overflow and negative output. Switching to BigInteger did the trick :-). A reference would be good, though. I put a note on the contributing editor's talk page. — vijay 22:24, 14 May 2006 (UTC)
 * Great stuff; thanks for confirming that. I'll get in touch with some people about getting a ref for this formula, and also the one queried below (which again is unfamiliar to me too).Robma 07:29, 16 May 2006 (UTC)

Robma, please specify which formula you are removing from the article instead of just referring to it on the talk page as "this" formula so that editors don't have to hunt through the page's history (which is easy now, but won't be so easy months in the future). Thanks! Anyway, the formula under discussion here, for the benefit of people reading this talk page, is:


 * $$f(n) = 2 + [(2 (n!)) \,\operatorname{mod} (n+1)].$$

I've restored it, since it seems from the above discussion and that the formula is correct, even if we still are missing a citation. The formula was originally added by User:LC to the prime number article and then moved to this article by User:Henrygb. &mdash;Lowellian (reply) 04:46, 25 May 2006 (UTC)

I believe that this group wrote the first paper on this. https://www.tandfonline.com/doi/full/10.1080/00029890.2019.1530554?scroll=top&needAccess=true — Preceding unsigned comment added by 47.184.33.213 (talk) 17:20, 6 December 2020 (UTC)


 * Ah, ha! With a little help from a friend, here is the proof, which is rather trivial:


 * First, consider the case where n is one less than a prime, that is, when $$n = p - 1$$. This is equivalent to saying that the modulus $$n + 1$$ is prime. Then:


 * $$f(n) = 2 + [2n! \,\operatorname{mod} (n+1)]

= 2 + [2(p - 1)! \,\operatorname{mod} ((p - 1)+1)] $$


 * Applying Wilson's theorem, we get:


 * $$f(n) = 2 + [2(-1)\,\operatorname{mod}\,p]

= 2 + (-2\,\operatorname{mod}\,p) = 2 + (p - 2) = p $$


 * So clearly, when the modulus $$n + 1$$ is a prime p, $$f(n) = p$$, so when $$n + 1$$ is prime, $$f(n)$$ ranges over all the primes.


 * Now, we still have to prove that when $$n + 1$$ is not prime, we get $$f(n) = 2$$. To prove this, all we need to do is show that $$n! \,\operatorname{mod} (n+1) \equiv 0$$, since then that term drops out, leaving only the 2. We proceed to do this:


 * If $$n + 1$$ is not prime, then we can write $$n + 1 = pk$$, where p is the smallest prime that divides $$n + 1$$. Clearly, since p and k are both factors of $$n + 1$$, we have $$p < n + 1$$ and $$k < n + 1$$. Unless $$p = k$$, both p and k are distinct factors of the expansion $$n! = n \times (n - 1) \times (n - 2) \times ... \times 1$$, implying that $$n!\,{mod}\,(pk) \equiv n!\,{mod}\,(n + 1) \equiv 0$$.


 * Now, let's take the final case, where $$n + 1 = pk$$ and $$p = k$$, that is, wherein $$n + 1 = p^2$$. We know $$p < n + 1$$, since p is the square root of $$n + 1$$, and $$2p < n + 1$$, since for all integers $$m \ge 3$$, $$2m < m^2$$. Therefore, the expansion $$n! = n \times (n - 1) \times (n - 2) \times ... \times 1$$ contains both 2p and p, so $$p^2 | n!$$ and $$n!\,{mod}\,(p^2) \equiv n!\,{mod}\,(n + 1) \equiv 0$$. QED.


 * &mdash;Lowellian (reply) 04:19, 26 May 2006 (UTC)

Moved formula from article
I have reverted the following addition to the article. My edit summary "revert latest edit. Very complicated formula with no explanation. Sums 2^n numbers to find nth prime. Must be among the slowest ever if it works" PrimeHunter 01:03, 8 August 2007 (UTC)

Formula elaborated by Lainé Jean Lhermite Junior
$$P_n = \sum_{i=1}^{2^n}h(i) $$

visit : http://www.institutionscle.nombrespremiers.net

$$P_n = \sum_{i=1}^{2^n}\left(\left\lfloor\frac {1+ \sum_{m=1}^{i}{\left( 1-\left\lfloor{\frac{\left\lfloor{\frac{\left(m!\right)^2}{m^3}}\right\rfloor}{\frac{\left(m!\right)^2}{m^3}}}\right\rfloor\right)}}{n+1}\right\rfloor\times{\left\lfloor\frac{n+1}{1+ \sum_{m=1}^{i}{\left( 1-\left\lfloor{\frac{\left\lfloor{\frac{\left(m!\right)^2}{m^3}}\right\rfloor}{\frac{\left(m!\right)^2}{m^3}}}\right\rfloor\right)}}\right\rfloor}\times{i}\times{\left({1-\left\lfloor{\frac{\left\lfloor(\frac{\left(i!\right)^2}{i^3}\right\rfloor}{\frac{\left(i!\right)^2}{i^3}}}\right\rfloor}\right)}\right) $$

Polynomial equations
Hank Harrell has done work in this area He claims the following produces 12 fold the # primes over what is expected on average (using P#=151*149*139*...2,c=73033421, x={1,1000}). In fact it produces 85 primes in this range::


 * candidate = P#*x^2-P#*x + C,     where P# is a primorial and C is a positive integer

Essentially it is a "prime candidate -generating" equation akin to the older classics but yielding much larger primes--Billymac00 (talk) 17:03, 18 February 2008 (UTC)

Goldbach's conjecture
in effect, [Goldbach's conjecture] is a simple (iterative) prime "formula" always returning 2 primes each >=5 from each input pair described as:

starting with 2 integers (same parity, at least 1 not prime,>=6),


 * (N1,N2) via (N1-d,N2+d) will yield 2 primes < (N1+N2)


 * where max d = max(N1,N2)-5                 [d,N1,N2 are all positive integers]

An example is (39,25) which generates (4) pairs (max d=34)


 * (23,41), (17,47), (11,53), (5,59)

[Another solution (3,61) exists outside of the conditions prescribed above ]

Similarly, (32,32) generates the same (4) pairs as 32+32 =39+25 (identical sums)

It generates "varied" bounded primes [unsure if every prime gets generated (imagine so)]--Billymac00 (talk) 22:17, 6 March 2008 (UTC)

Error in Formula based on a system of Diophantine equations
The given prime-generating polynomial seems to be wrong. The right formula should be: (K+2)(1-α12-α22-...-α142). 89.138.48.98 15:30, 9 April 2007 (UTC)


 * You're absolutely right. Thanks a lot! -- Jitse Niesen (talk) 01:47, 10 April 2007 (UTC)


 * Yet neither of you corrected it, anyway it's done now. Smithers888 (talk) 22:36, 13 June 2008 (UTC)

Wikipedia's Expert Peer Review process (or lack of such) for Science related articles
Hi - I posted the section with the same name on my talk page. Could you take part in discussion ? Thanks ARP Apovolot (talk) 21:28, 25 October 2008 (UTC)

Small arithmetic change
I'm sure that
 * $$\operatorname{IsPrime}(n) =

\left\lfloor \frac{(n - 1)! + 1}{n} \right\rfloor + \left\lfloor -\frac{(n - 1)! + 1}{n} \right\rfloor + 1 $$ ...is exactly the same as...
 * $$\operatorname{IsPrime}(n) =

2\left\lfloor -\frac{(n - 1)! + 1}{n} \right\rfloor + 1 $$ No? Ignore this, I missed the negative sign. 58.7.8.182 (talk) 16:05, 30 June 2009 (UTC)

Formula based on Wilson's theorem
I removed the following text from the section "Other formulas":
 * This formula is wrong and no longer is able to creat many of prime numbers, i.e. i have examined it for n = 18 and it's result was not correct! This formula has generate 2 for every n greater than 19. And for n = 18 the result is 18 that is obvious it is'nt a prime number!!
 * —Preceding unsigned comment added by Threepehr (talk • contribs) 04:39, 12 May 2008

I tried it out for n = 18, and I got 19, just as the theory predicts. -- Jitse Niesen (talk) 11:38, 12 May 2008 (UTC)


 * Yes, the formula is correct. The IP must have evaluated it incorrectly. PrimeHunter (talk) 18:00, 12 May 2008 (UTC)


 * Can people who don't know much mathematics not edit maths articles please. The Wilson formula is pretty trivially correct and well-known —Preceding unsigned comment added by 94.172.196.23 (talk) 12:15, 19 July 2009 (UTC)

MILLS formula is WRONG!
PROGRAM ImbalzanoG; begin REPEAT write("MILLS formula is WRONG!") until TRUE end. (*All the best!*) —Preceding unsigned comment added by Imbalzanog (talk • contribs) 13:33, 29 August 2009 (UTC)


 * I guess you are User:Jmbalzan who made this edit. Please don't make edits about the same thing using different accounts. See Sock puppetry. Mills' constant lists reliable sources for the formula and the statement that it's unknown whether Mills' constant is rational. Wikipedia does not allow original research. PrimeHunter (talk) 16:08, 29 August 2009 (UTC)

OK! =  but the 'MILLS formula is wrong! In fact (IF A=1.30637788386308069046) for n=0, 1, 2, .., 4 one obtain the "prime numbers".. 1, 1, 2, .., 1361, but for n=3 one obtain 8 ..NOT 11, like from the sequence 1, 1, 2, 11, 1361, 2521008887.. or the Riemann hypothesis is wrong?! All the best for this! Prof. Giovanni Imbalzano, ThanX. —Preceding unsigned comment added by Imbalzanog (talk • contribs) 19:50, 29 August 2009 (UTC)


 * Your calculation for n=3 is wrong, and the primes start at n=1, not at n=0. For n = 1, 2, 3, 4, ...
 * floor(A(3 n) ) = 2, 11, 1361, 2521008887...
 * For n=3 it is floor(A(3 3) ) = floor(A27) = floor(11.082031) = 11. No integer n gives the value 8. PrimeHunter (talk) 20:14, 29 August 2009 (UTC)

Sorry! My (PASCAL and) FORTRAN program done: A^(n^3)= A(2^3)=8.483021265734882348686267276902336962502905672556765306326251816065644520340083810648493349954739074,

Just checking
In the first sentence, the phrase "exactly and without exception"... that means "every prime, and no non-prime", yes? DS (talk) 13:19, 23 August 2010 (UTC)

Concerning the paper of Venu Atiyolil
I am going to note that the mentioned formula has a running time of at least seeking out the next prime and trial dividing in any practical case.

—Preceding unsigned comment added by 69.254.220.41 (talk • contribs) 21:26, 4 October 2006

It is the first explicit formula for the nth Prime. Nothing to do with running time. It could be simplified if done enough research. —Preceding unsigned comment added by 74.97.4.93 (talk) 01:21, 23 December 2010 (UTC) ________________________________________________________________________________________________________

Problems with the proof at "Prime formulas and polynomial functions"
The proof that "no non-constant polynomial function P(n) exists that evaluates to a prime number for all integers n."

1. Assumes that all the coefficient of the polynomial are integers - which is not true see for example http://www.maa.org/editorial/mathgames/mathgames_07_17_06.html where there is a polynomial of order 5 with 57 conservative primes.

2. Is not simple at all - need more clarification. —Preceding unsigned comment added by 84.109.83.123 (talk) 19:59, 19 July 2010 (UTC)

Please study Venu Atiyolil formula. It gives the nth prime by polynomial with a condition that one needs to take the integral part of the result. In simple words, the result may be 5.00234567.... and the integral part is 5 which yield the 3rd prime so on and so forth to infinity. —Preceding unsigned comment added by 74.97.4.93 (talk) 01:27, 23 December 2010 (UTC)

The primes for n = 0, 1, 2, 3... are 41, 43, 47, 53, 61, 71 (in Euler formula)
Actually 41, 41, 43, 47, 53, 61, 71 ...... —Preceding unsigned comment added by 165.228.167.155 (talk) 04:02, 4 February 2011 (UTC)


 * Fixed in . The idea is to produce 40 distinct primes so for n2 − n + 41 it's n from 1 to 40 (there is a variation n2 + n + 41 where it's 0 to 39). PrimeHunter (talk) 04:25, 4 February 2011 (UTC)

Venugopalan Atiyolil's formula for the (n+1)th Prime
"In the Proceedings of the Indian Academy of Sciences(Math. Sci.), Vol.92, No.1,September 1983 pp 49-52, an explicit formula for the (n+1)th Prime which is the same as nth Prime as n could be substituted for n+1 for a given integer. In other words, if one wants to find the 6th Prime Number, then the integer n=5. The paper also gives a formula for the (n+1)th Twin prime which is the same as the nth Twin Prime. Further, the paper gives formulae for number of Primes and Twin Primes less than any given Prime. The proof is written in a cumbersome format to avoid plagiarism and therefore it is difficult to follow. The following link includes all the pages of the said paper: https://www.ias.ac.in/article/fulltext/pmsc/092/01/0049-0052"

This paragraph is hard to understand. Here is my suggestion, but I haven't implemented it because I am uncertain that my reformulation replicates the meaning of the original.

"In the Proceedings of the Indian Academy of Sciences(Math. Sci.), Vol.92, No.1, September 1983 pp 49-52, an explicit formula for the nth prime number is given. The paper also gives a formula for the nth twin prime. Further, the paper gives formulae for the number of primes and twin primes less than any given prime. The proof is written in a cumbersome format to avoid plagiarism and therefore it is difficult to follow. The following are the pages of the paper. https://www.ias.ac.in/article/fulltext/pmsc/092/01/0049-0052"--Dougall 07:47, 14 July 2006 (UTC) - One good thing of these formulae is that the paper gives a formula for the number of twin primes. The twin prime conjecture is still unsolved ! All formulae are very correct with consideration to errata published which could be viewed at the link https://www.ias.ac.in/article/fulltext/pmsc/093/01/0066-0066).     — Preceding unsigned comment added by 72.87.101.104 (talk) 01:44, 29 June 2011 (UTC) --  The reason why some people could not understand the above paper is becasue they don't interpret [  ] as INTEGRAL PART in step 16 of the page 51 of the paper to get the (n+1)th prime.

Can someone elaborate or simplify proof of this formulae for Prime Numbers, Twin Primes, Number of Primes and number of Twin Primes as the formula is correct if you read the errata (00000068.pdf), later published. It seems there was a printing error which was later corrected. Proceedings of the Indian Academy of Sciences only publishes papers after three referees(mathematicians) who peruse the contents as correct to be published. Sometimes there could be printing errors. The sign [ ] is denoted for integral part -not just a bracket!

After reading all these criticisms on a mathematically correct issue, which was refereed by three mathematicians, it seems only reasonable that the Author chose to publish the proof in an obscure way to avoid stealth by greed. Be positive in thinking and you would only indulge yourself into elimination of myth manufactured by ignorance. No wonder people quit research as it is sometime non-rewarding and a subject of negative criticism. The papers stands still with no progress even after all these years when the Author was just about to prove or disprove twin prime conjecture. Learn a lesson from it. -- —Preceding unsigned comment added by 64.223.54.183 (talk)

Sabihi paper and revert war
wikipedia has a guideline WP:3RR to prevent revert wars. We appear to have one about the Sabihi paper. I had a look for for citations for the paper "A Novel Explicit Formula for Computing π(x), the Number of Primes" and I could not find any so it does not meet the standards for a Reliable source and may falls Original research. Rather than revert the matter needs to be discussed here on the talk page, or further actions pike page protection may be needed.--Salix (talk): 22:53, 3 November 2012 (UTC)


 * There is a discussion of this material at Wikipedia_talk:WikiProject_Mathematics. Deltahedron (talk) 07:31, 4 November 2012 (UTC)

About the Diophantine equations
since the link to the natural numbers gives two different definitions, i suggest to write that the solutions must be in non-negative integers (as in the original article) i suspect that no solution is known, am i right in thinking this? — Preceding unsigned comment added by 2A00:1620:C0:64:21C:61FF:FE03:A4C (talk) 13:41, 14 December 2012 (UTC)

Formula for the nth prime
In User:BenCawaling/Essay it is written: "here's a forula for the nth prime: $$p_n = 1 + \sum_{m=1}^{2^n} \left\lfloor \left\lfloor { n \over 1 + \sum_{j=2}^m \left\lfloor {(j-1)! + 1 \over j} - \left\lfloor{(j-1)! \over j}\right\rfloor \right\rfloor \ } \right\rfloor^{1 \over n} \right\rfloor.$$" Jayme (talk) 14:42, 24 December 2012 (UTC)

A formula for determining if a natural number n is prime or not has been developed by Chris De Corte

 * $$ \prod_{i=2}^{(n-1)} \sin \left( {\pi \cdot n \over i} \right) <>0 \Rightarrow Prime $$

This formula might not be very practical to calculate large numbers but for having theoretical discussion like solving Goldbach's Conjecture or the Twin Prime Conjecture, it is very handy.

http://www.slideshare.net/ChrisDeCorte1/derivation-of-a-prime-verification-formula-to-prove-the-related-open-problems — Preceding unsigned comment added by Chrisdecorte (talk • contribs) 08:55, 17 July 2013‎
 * Has this formula been published in a peer-reviewed mathematical journal, or attracted other significant coverage in the academic or mainstream media? If so please provide the bibliographic details and perhaps it can be added to the article. —Psychonaut (talk) 09:27, 17 July 2013 (UTC)


 * At commons:File:Formula to separate primes from non primes.png you uploaded an image of the formula
 * $$ P(n) = \prod_{i=2}^{n-1} \sin(\frac{\pi n}{i}) <> 0 => n = \text{Prime}$$
 * That's a very convoluted way to do trial division. I don't see how it could be handy for theoretical discussion. And in any case, we would need good published math sources as Psychonaut says. See No original research. You have a conflict of interest so you should have started with a talk page suggestion and not by adding it to the article. PrimeHunter (talk) 11:21, 17 July 2013 (UTC)

THE PRIMES FORMULA
Why nobody wrote "the primes easiest formula" ?

P is a prime if for P>=5

$$ z= P! / P^2 $$

z is a non integer.

So

THE NUMBER OF PRIMES BETWEEN 0 AND X IS

$$\ Pi(x) = \sum_{P = 5}^{\ x}{ [Int ((P!/P^2)-int(P!/P^2)]+0.3 +2 }$$

And the next prime will follow in a non elegant "formula" that is an algorithm that use the previous one in this way:

- given P(x) (x is unknown) - find (x) with the upper formula - i+1 will be the target - pull-up to 1 the primes - pull down to 0 the non primes - keep an upper limit for sure majour than P(i+1) - sum the 1 results - pull down to zero any result majour of the first P(i+1) discovered after Pi

I saw somewhere a more nice formula (1968) that use Int and sin... — Preceding unsigned comment added by 94.81.217.96 (talk) 05:16, 7 November 2013 (UTC)

YAFFP
I reverted Yet Another Formula For Primes (my terminology) added by an IP sourced to reference. It might be correct but even if so appeared to be WP:UNDUE. Deltahedron (talk) 07:08, 1 June 2014 (UTC)

WNFFP
Welcome New Formulas For Primes (my terminology), this article and its talk page are about various formulas (old and new) for primes. I undo revision 611038897 by Deltahedron (if he/she don't mind), for two reasons: 1. Reference:, is a reliable reference from Hokkaido University (and not appeared to be WP:UNDUE), 2. Although there are many interesting and important formulas for primes, but we see only one or two of them in the article. Definitely there should be more formulas in the article, because this is a very active research field not only in number theory, but also in many other fields.JohnAu2000 (talk) 11:31, 1 June 2014 (UTC)


 * Obviously I don't agree at the moment, see my comments above. It would help editors to form a consensus here if you were to explain firstly, what the formula actually is: the original poster simply described it, writing "An algebraic function with a sort of linear property for redefinition and subsequently generation of prime numbers", which conveys very little information; and also, to say why it is important, or rather, more important than all the other formulae that might be included.  Importance would be signified, for example, by other, independent, authors citing it, using it or commenting on it.  Is there a review of the paper in Math Reviews or Zentralblatt that would help?  Deltahedron (talk) 11:46, 1 June 2014 (UTC)
 * It does not appear to be listed in MathSciNet, which to me calls into question its reliability as a mathematics reference. —David Eppstein (talk) 16:14, 1 June 2014 (UTC)
 * The lack of a consistent style for the series (in terms of formatting, language, and genre), the use of Microsoft Word to "typeset" certain volumes, and the lack of an ISSN all point towards this not being a reliable source of mathematics research. Not conclusive proof, of course, but certainly more than enough to raise suspicion. —Psychonaut (talk) 20:30, 1 June 2014 (UTC)

Reference: is a paper published by a good level university; in any case I am searching on it, and trying even to contact the authors of that paper. But, more formulas for primes and relevant works should be added to the main article. I hope that scientists like professor Eppstein help for this matter. — Preceding unsigned comment added by JohnAu2000 (talk • contribs) 19:35, 1 June 2014‎
 * Could you perhaps address Deltahedron's question as to what specifically makes this formula any more worthy of inclusion than all the other ones? For example, has it attracted a particularly high number of citations from those working in the field?  Is it particularly easy to understand, and therefore a good example for an introductory-level explanation?  Does it use a particularly novel approach?  I hope you understand that we're not writing a formal survey article here which aims to cover every known formula for primes; rather, this is an encyclopedia which is intended to present a broad overview of the history and state of the art.  Obviously it is of benefit to have a few examples of such formulas, though we need to exercise some editorial discretion in which ones to present.  Please help us out by explaining why this one is a good candidate. —Psychonaut (talk) 20:16, 1 June 2014 (UTC)

Mills
Numerous fatuous generalisations of Mills's fatuous formula exist. — Preceding unsigned comment added by Ice ax1940ice pick (talk • contribs) 13:54, 21 June 2014 (UTC)


 * It may be useless to find primes but it's a famous theoretical result and belongs here. We would need a good reason to include less known generalizations. PrimeHunter (talk) 14:55, 21 June 2014 (UTC)


 * See http://primes.utm.edu/notes/proofs/A3n.html — Preceding unsigned comment added by 86.176.253.155 (talk) 15:11, 21 June 2014 (UTC)

Kvant Selecta
The publisher of Kvant Selecta: Algebra and Analysis is the American Mathematical Society, as is clear from the cover of the book and the copyright page. The AMS maintains an online Bookstore at its website, at which the book may be bought. Changing the publisher field from "American Mathematical Society" to "American Mathematical Society Bookstore" as here is not correcting an error but introducing one. Deltahedron (talk) 17:11, 1 July 2014 (UTC)

Formulas that frequently produce primes
Do you know of any other formulas that produce primes so frequently?? Name some. — Preceding unsigned comment added by 66.32.255.166 (talk) 23:53, 6 March 2004 (UTC)


 * Try Prime number and the section "Formulas yielding prime numbers" which has some. It is rather better than this page, so I will copy the content from there to here.  --Henrygb 00:41, 7 May 2004 (UTC)


 * Look up the Ulam spiral. It is basically the integers written out in a square spiral. Highlighting the primes produces lines (albeit with gaps) that show what seems like a pattern. These lines (and there are many of them) have equations associated with them. One example of which is $$4n^2 - 2n + 41$$, which generate the numbers that appear on a given line. These lines are special because they are unusually dense with primes.  The first 21 (n=0 to 20) are guaranteed to produce primes (100%). The first 100 have a 79% chance of being prime. The first 1,000 have a 50% chance of being prime. At 10,000 it's only 37%, but its still far better than randomly guessing from arbitrary integers. I hope this answers your question or at least gives you something to go on. --67.168.137.181 (talk) 21:15, 5 November 2014 (UTC)

Reversion of changes by an anon
I've reverted all the changes by this anon guy. He keeps adding info to articles when it's been moved from one article to another, and he also has been deleting/altering comments on talk pages. CryptoDerk 03:14, Mar 5, 2005 (UTC)

So? Why delete his contributions to articles if they are legitimate? Should information be listed only once at one particular location on the wiki? If so, how does one find it if it is not explicitly referred to and directed to in other articles? I think its petty to delete valid information, even if it is already in other articles in more detail. Granted, his deleting conversations is unacceptable. But your deleting valid information is almost as bad. --67.168.137.181 (talk) 21:21, 5 November 2014 (UTC)
 * You did notice that you were replying to a comment that's over nine years old, right? —David Eppstein (talk) 22:23, 5 November 2014 (UTC)


 * Are you aware that you are replying to a post from 2005 and CryptoDerk has not edited since 2012? Did you examine whether there was anything of value in the mentioned edits? PrimeHunter (talk) 22:30, 5 November 2014 (UTC)

Reccurrence relation
Hi, I added this text

The similar reccurrence relation starting with {\displaystyle (2,1,1)} (2,1,1) which returns either {\displaystyle (a_{n},b_{n},c_{n})=(a_{n-1},b_{n-1}+1,1)} {\displaystyle (a_{n},b_{n},c_{n})=(a_{n-1},b_{n-1}+1,1)} if {\displaystyle gcd(a_{n-1},b_{n-1})=1} {\displaystyle gcd(a_{n-1},b_{n-1})=1} and otherwise which returns {\displaystyle (a_{n-1}+1,1,gcd(a_{n-1},b_{n-1}))} {\displaystyle (a_{n-1}+1,1,gcd(a_{n-1},b_{n-1}))} results in the sequence {\displaystyle c_{1},c_{2},...} {\displaystyle c_{1},c_{2},...} such that when entries of 1 and repetitions are deleted, it is obviously just the sequence of prime numbers itself in increasing order.

An editor deleted it as unreferenced. There is no reference, it is just the observation that it is not difficult to write down such a recursive function which lists not only some of the primes but all of them. Perhaps someone can find a reference to the general theorem of logic and put my example back as illustrating that this is possible? Thx. Createangelos (talk) 12:07, 25 June 2016 (UTC)

OK I found a ref and put this in, hope it's OK. Createangelos (talk) 12:58, 25 June 2016 (UTC)


 * I do not think there is a source for this specific recurrence relation. Is it obvious that it returns the primes?  Sławomir Biały  (talk) 13:45, 25 June 2016 (UTC)

Oh hi, nice to meet you. I think it should work similarly to the other example but is just very simple. For each number a, the number b counts 1,2,3,4,5,6,7,..... until there is a nontrivial gcd with a (which is obviously then the smallest prime divisor of a), then c takes that value, b is reset to 1, and a increases to the next value. Actually the starting value better be (2,1,1) or it gets stuck. Thus (a,b,c) takes the values 2 1  1 ; 2 2  1; 3  1  2; 3  2  1; 3  3  1; 4  1  3; 4  2  1; 5  1  2; 5  2  1; 5  3  1; 5  4  1; 5  5  1; 6  1  5; 6  2  1; 7  1  2; 7  2  1;

The values of c when the 1's are deleted 2,3,2,5,2,... are the smallest prime divisors of 2,3,4,5,6,... and when repetitions are deleted  it is 2,3,5,7,... Createangelos (talk) 19:40, 25 June 2016 (UTC)

Formula for all non-primes of interest?
I find this occasionally useful:

$$ \bar{P} =\{(n+1)(m+1) | m,n > 1\}. $$

Is it worth being included?
 * It's obviously correct, but do you have a reliable source for its significance wrt the article subject? —David Eppstein (talk) 19:43, 18 June 2017 (UTC)
 * No, unfortunately I haven't. --91.115.119.236 (talk) 17:30, 19 June 2017 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified one external link on Formula for primes. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20120224013618/http://mathdl.maa.org/mathDL/?pa=content&sa=viewDocument&nodeId=2967&pf=1 to http://mathdl.maa.org/mathDL/?pa=content&sa=viewDocument&nodeId=2967&pf=1

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 19:23, 20 September 2017 (UTC)

Correct formula
I have a doubt with the formula for n-th prime, i have never seen it demonstrated i mean: --Karl-H 20:35, 15 May 2006 (UTC)


 * $$p_n = 1 + \sum_{m=1}^{2^n} \left\lfloor \left\lfloor { n \over 1 + \pi(m) } \right\rfloor^{1 \over n} \right\rfloor.$$

N.B. The $$2^n$$ can be drastically lowered with $$k^n$$ with k < 1.5. But this is a double-exponentiated formula with respect of bits in n, so this should be used only for testing processors with fixed small n (for example, n = 15 or 20). Pasha20d00 (talk) 11:20, 1 May 2019 (UTC)

Polynomial formulaes --> editing a bit
At the moment it is written: "A general theorem of Matiyasevich says that if a set is defined by a system of Diophantine equations, it can also be defined by a system of Diophantine equations in only 9 variables. Hence, there is a prime-generating polynomial as above with only 10 variables. However, its degree is large (in the order of 1045)."

This can be misunderstood by reader like this: "the degree of any prime-generating polynomial with 10 variables is at least 10^45" --> however, only the currently known method of getting such polynomial require degree 10^45; there is a chance that someone will find the prime-generating polynomial with 10 variables using completely other method and get much smaller value. As far as I understand the only 2 known results about prime-generating polynomials are that if such polynomial has A variables and B is its degree, then A>1 and B>1 (and no better estimations are known), so, there is a chance that some polynomial with 2 variables of degree 2 is prime-generating.

If someone can rewrite the text a bit to exclude such misunderstanding, this will be great (my English is not very good as you see). Thanks.

—Preceding unsigned comment added by 217.150.50.194 (talk • contribs) 10:40, 25 May 2007 (UTC)

=>FLOOR=8 NOT 11 but I use A=1.30637788386308069046 and "real or complex number calculations with 100-significant-figure precision. " ..AND for n=3: 1361.000001079726460999192860124432416917474694599497777199482905339934552915037249561521962884051614 Evident! The formula is A^(3^n) NOT A^(n^3)..! PARDON, but I search of verifies again ! FOR n=4 FORTRAN done: A^(3^n)= 2521008886.999999998653456843300060421152569980618097269190530906867869731446814744897933120185555674, FLOOR=2521008886 NOT prime, CEIL=2521008887... —Preceding unsigned comment added by Imbalzanog (talk • contribs) 20:52, 29 August 2009 (UTC) ..AND finally FOR n=5: A^(3^n)= 16022236204009818106157512334.85693084207614172497541238587106571181797337053375889904228588259040492 FLOOR=16022236204009818106157512334, CEIL=16022236204009818106157512335, both NON prime! THEN or MIILS or RIEMANN hypothesis is FALSE.. or BOTH! G.I. —Preceding unsigned comment added by Imbalzanog (talk • contribs) 20:58, 29 August 2009 (UTC)

You don't have enough decimals of A in your calculations. Here are 600: A = 1.30637788386308069046861449260260571291678458515671\ 36443680537599664340537668265988215014037011973957\ 07296960938103086882238861447816353486887133922146\ 19435345787110033188140509357535583193264801721383\ 23615223590622186016108566790572151979760951619929\ 52797079925631721527841237130765849112456317518426\ 33105652153513186684155079079372385923352208421842\ 04053205176890260257934430086952906362056989687262\ 12274997876664385157661914387728449820775905648255\ 60915004123788524793626088046688154064374425340131\ 07361144094137650364379301267672117131030265228386\ 61546668804874760951441079075406984172603473107746

This precision gives 6 primes: 2, 11, 1361, 2521008887, 16022236204009818131831320183, 4113101149215104800030529537915953170486139623539759933135949994882770404074832568499. The 7th number is composite when A is "only" given to the 600 decimals above. PrimeHunter (talk) 21:50, 29 August 2009 (UTC)

Thank you, but inform the readers of this necessity. Besides, I am convinced that all this is an "artificial construction": we could get analogous results in many other ways, without importance for the mathematics... OK? G.I. —Preceding unsigned comment added by Imbalzanog (talk • contribs) 19:44, 30 August 2009 (UTC)


 * Formula for primes says: "the smallest such A has a value of around 1.3063... and is known as Mills' constant". I don't see what more is neeed. "..." signals there are more decimals. Of course you don't get exact results if you only include some of the decimals. I don't see a good reason to mention exactly how many decimals are needed to get the right prime for n=4 when none of the primes for any n value is mentioned in Formula for primes. However, a couple of days ago I edited Mills' constant in to display the decimals required to get the primes listed in that article: 2, 11, 1361, 2521008887. Mills proved a non-trivial result which has interested many people and is mentioned in many reliable sources. I think it belongs here much more than many of the useless formulas to generate primes with convoluted expressions which are just equivalent to a very slow form of trial division. PrimeHunter (talk) 02:03, 31 August 2009 (UTC)

Now I agree, for the satisfactory article of citation. This confirms also my opinion, that the hypothesis of Riemann is dynamic: the hypothesis is true because and until we may build the mathematics... but in the same time the mathematics coherence is indefinite (Kurt Gödel). Imbalzanog (talk) 15:02, 2 September 2009 (UTC)