Talk:Formula for primes

Atiyolil Venugopalan
I found out another published work done by Mr. A.Venugopalan aka Atiyolil Venugopalan on Prime numbers. The paper was published in the Hardy-Ramanujan Journal Vol.6 (1983) 45-48. It could be viewed at the link: https://hrj.episciences.org/99 — Preceding unsigned comment added by 70.192.21.85 (talk) 14:47, 10 August 2014 (UTC)

The following four formulas were published in the Proceedings of the Indian Academy of Sciences. Volume 92, No.1 September 1983 edition, pages 49-52.


 * I have LaTeX translated Venugopalan's formula. It is given below:
 * $$P_{n+1}^{2}\text{ = 1 + }\left| \text{ }-{{\log }_{X}}\left( {\scriptscriptstyle 1\!/\!{ }_2}\text{ }\sum\limits_{{{a}_{1}}=1}^{{{p}_{1}}-1}{...\sum\limits_{{{a}_{n}}-1}^{{{p}_{n}}-1}{\sum\limits_{b=1}^{n}}}-\text{ 1/X } \right) \right|$$
 * He says X could be any number (not an integer). I guess, we could use Euler's constant "e" in place of X so that $$Lo{{g}_{x}}$$ will be Natural logarithm for ease of computation. — Preceding unsigned comment added by 64.121.225.161 (talk) 15:20, 13 August 2014

For P differs from zero, P is the first Twin prime between $${{p}_{n}}$$ and $$p{{_{n}^{2}}_ – }$$ and it is given by the formula below:

$$P\text{ = Y}\sqrt{\left( 1-\left| {{\sin }^{2}}\left( \frac{\pi }{2}-\left[ {{2}^{-\left( {{Y}^{2}}\_{{p}^{4}}_{n} \right)}} \right] \right) \right| \right)}$$

where,

$${{Y}^{2}}=\text{ }\left( 1+\left| -{{\log }_{x}}\left( \frac{1}{2}\sum\limits_{{{a}^{'}}_{1}\ne \text{ }{{a}_{1}}=1}^{\left( {{p}_{1}}-1 \right)}{...}\text{ }\sum\limits_{{{a}_{n}}^{'}\ne {{a}_{n}}=1}^{\left( {{p}_{n}}-1 \right)}{\sum\limits_{b=1}^{n}{{{X}^{-{{\left( \sum\nolimits_{1}^{n}{{{a}_{i}}{{Q}_{i}}-bQ} \right)}^{2}}}}\_\left( \frac{1}{X} \right)}} \right) \right| \right)$$

$$X=any\text{ }positive\text{ number, }\left( {{a}^{'}}_{1},{{a}^{'}}_{2},...,{{a}^{'}}_{n} \right)be\text{ unique solution of}$$

$$-\text{2}\equiv \text{ }\sum\nolimits_{1}^{n}{{Q}_{i}}\bmod Q\text{ with 0}\le {{\text{a}}_{i}}\le \left( {{p}_{i}}-1 \right)\text{ ,}$$

$$i=1,2,3..,n\text{ and n}>1$$

$$\begin{align} & \text{For any integer x in }\left( {{p}_{n}},p_{n}^{2} \right),\text{ the number of primes not greater than x,} \\ & \text{is given by the formula below:} \\ & \\  & \prod{\left( x \right)}=\text{ }\frac{1}{2\pi }\int\limits_{0}^{2\pi }{\prod\limits_{i=1}^{n}{\frac{\sin \left( \left( \left( Q-{{Q}_{i}} \right)/2 \right)\theta  \right).\sin \left( \left( n-1 \right)Q\theta /2 \right).\sin \left( x\theta /2 \right)\cos \left( \left( x+1 \right)\theta /2 \right)}{\sin \left( {{Q}_{i}}\theta /2 \right).\sin \left( Q\theta /2 \right)\sin \left( \theta /2 \right)}}}d\theta +n \\ & where, \\ & {{Q}_{i}}\text{ = }Q/{{p}_{i}}\text{ for }i=1,2,3,...,n \\ \end{align}$$

$$\begin{align} & \text{If }\prod\nolimits_{2}{\left( x \right)\text{ represents }}\text{the number of twin-primes not exceeding integer x } \\ & \text{for }{{\text{p}}_{n}}\langle \text{ x }\langle p_{n}^{2}\text{, then,} \\ & \prod\nolimits_{2}{\left( x \right)}\text{ = }\frac{1}{2\pi }\int\limits_{0}^{2\pi }{\sum\limits_{{{a}_{1}}\ne a_{1}^{'}}^ – {...\sum\limits_{{{a}_{n}}\ne a_{n}^{'}}{\sum\limits_{b=1}^{\left( n-1 \right)}{\sum\limits_{t=1}^{x}{\cos \left( \sum\nolimits_{1}^{n}{{{a}_{i}}{{Q}_{i}}-bQ} \right)}}}}}\theta \cos \left( t\theta \right)\text{ }d\theta +\prod\nolimits_{2} \\ & where, \\ & Q=\prod\limits_{i=1}^{n}\text{ for }i=1,2,3...,n\text{ and }{{Q}_{i}}=Q/{{p}_{i}} \\ & \text{Since all twin-primes upto and including }{{\text{p}}_{n}}\text{ are known }\prod\nolimits_{2}{\left( {{p}_{n}} \right)}\text{ is known}\text{.} \\ & \text{Twin-prime conjecture follows immediately if}\prod\nolimits_{2}{\left( x \right)}\text{ is greater than } \\ & \prod\nolimits_{2}\text{ for any integer x}\text{.} \\ \end{align}$$


 * It would help if you would describe the formulae here and say why they are as significant as any of the very many others that might be included in this article. Have they been the subject of extensive published commentary by other mathematicians?  Are they taught in standard text books?  Are they cited as the foundation of subsequent research?  See above under WNFFP for a similar proposal.  Deltahedron (talk) 15:35, 10 August 2014 (UTC)


 * The paper in question has no citations in MathSciNet. I would say that it is extremely unlikely that a result from such a paper would belong in a general article on the subject.  In any event, at a minimum we would need an independent secondary source about this formula, per WP:PSTS.   Sławomir Biały  (talk) 13:10, 13 August 2014 (UTC)
 * Venugopalan's paper is referenced in a text book entitled. "The Development of Prime Number Theory: From Euclid to Hardy and Littlewood. 2601:19A:27F:DFE0:487F:1B8E:AC92:DC05 (talk) 02:33, 23 October 2022 (UTC)

What is MathSciNet? Please look at the Proceedings of the Indian Academy of Sciences. Volume 92, No.1 September 1983 edition, pages 49-52. — Preceding unsigned comment added by 64.121.225.161 (talk) 00:40, 16 August 2014 (UTC)
 * Re MathSciNet: it is a database of mathematics papers, with reviews or abstracts, and also including links from papers to others that cite them. Yours has no such links. —David Eppstein (talk) 00:54, 16 August 2014 (UTC)


 * It appears that Venugopalan's paper reprints are sold for $44.95. There is a link to buy on MatSciNet of the ams.org/. Why can't they, at least, make the paper simpler by writing a review on it before linking it for sale. You may write to other number theoreticians who could comment on this. — Preceding unsigned comment added by 68.80.47.51 (talk) 15:55, 17 August 2014 (UTC)
 * There is a link from MathSciNet to the officual web site of the journal that published the paper. It is the journal publisher, a different organization, that is charging ridiculous amounts of money to look at the paper. This is what commercial academic publishers do, and why the open access movement (and preprint servers like arXiv) are important. —David Eppstein (talk) 16:55, 17 August 2014 (UTC)


 * Instead of justifying the addition of the content to the article, per the request of at least two editors, an anonymous editor has added yet more formulas here. It is not the content of the formula or formulas that was being discussed anyway, but rather whether there are secondary sources demonstrating the notability of these formulas.  If not, then they do not belong in an encyclopedia.  If so, then we can begin discuss content.  But posting more formulas here, some of which are only peripherally related to the subject of this article, is not likely to be constructive until this original criticism has been answered satisfactorily.   Sławomir Biały  (talk) 13:40, 21 August 2014 (UTC)
 * The formulas published by Venugopalan are correct. I had downloaded the reprints from the Proceedings of the Indian Academy of Sciences(Math. Sci.), Vol.92, No.1, September 1983 pp 49-52. The best way to understand the paper easily is to read the errata published first as the paper has a few printing or some sort of errors. I would recommend to move all the formulas to topic section of the encyclopedia as they are all correct and interesting.  — Preceding unsigned comment added by 139.55.56.236 (talk) 20:26, 21 August 2014 (UTC)
 * Correctness is not the relevant criterion, though. What's needed are secondary sources, like textbooks that use the formula, other papers in number theory that attest to the significance if these formulae.  Not every result that is published and correct belongs in an encyclopedia.   Sławomir Biały  (talk) 21:05, 21 August 2014 (UTC)

The importance of Mr. Venugopalan's formulas for prime numbers is that he is the first person who discovered explicit formulas for prime numbers, especially, for twin prime numbers and number of twin primes(emphasis added)! It is very surprising to note that to this day, no proof has been found to show there exists infinite number of twin primes even though Mr. Venugopalan brought us to the verge of showing whether or not there are infinite twin primes with his explicit formulas in 1983. — Preceding unsigned comment added by 24.173.7.42 (talk) 18:32, 6 January 2019 (UTC)

Is the section "A function that represents all primes" relevant?
The recurrence $$ f_n = \left\lfloor f_{n-1} \right\rfloor (f_{n-1} - \left\lfloor f_{n-1} \right\rfloor + 1 ) $$ does generate all the primes, but this is entirely dependent on $$f_1$$ being an encoding of the sequence of primes. Unlike with other formulas on the page, this formula has little to do with prime numbers. In fact, many sequences $$p_n$$ can be generated with this formula with the right choice of $$f_1$$. For example, using $$f_1 = e = 2.71828182845\ldots $$ will generate the sequence $$p_n=n+1$$, and using
 * $$f_1 = \sum_{n=1}^{\infty} \left((n+2)^2 - 1\right) \left(\prod_{i=1}^{n-1} (i+2)^2 \right)^{-1} = 9.84343604644290\ldots $$

will generate the sequence $$p_n=(n+2)^2$$. If this section is not removed, I think the section should at least note that many arbitrary sequences can be generated with this formula. Rzvhkon (talk) 03:18, 30 November 2020 (UTC)

"2.9200..." listed at Redirects for discussion
A discussion is taking place to address the redirect 2.9200.... The discussion will occur at Redirects for discussion/Log/2021 September 14 until a consensus is reached, and readers of this page are welcome to contribute to the discussion. Ivanvector's squirrel (trees/nuts) 16:40, 14 September 2021 (UTC)

False formula
Some different IPs have recently been trying to add the text
 * Another similar formula is $$f(n) = \left\lfloor \frac{(2^n-2) \bmod (n+1)}{n} \right\rfloor (n-1) + 2$$

to the article. This formula does not produce only prime numbers. When $$n+1$$ is a composite pseudoprime for the base 2 (the numbers 341 = 11 x 31, 561 = 3 x 187, 645 = 3 x 5 x 43, 1105 = 5 × 13 × 17, etc as listed in A001567) it will be produced by this formula, even though it is a composite number. If additional attempts at adding this material are made, they should be reverted on sight. —David Eppstein (talk) 06:54, 11 January 2022 (UTC)


 * I don't know, who posted "false" formula, but... thank you for your comment/discussion, David. Calculation of $(2^n-2)$ is faster than $(n!)$ . After getting pseudoprime numbers $$f_n = f(n)$$ you can make Primality test: slow Wilson's theorem $$f_{n-1}!\ \equiv\; -1 \pmod{f_n}$$, slow Trial division or fast APR-CL (Adleman–Pomerance–Rumely + Cohen–Lenstra). Mvitaminus (talk) 08:42, 24 November 2022 (UTC)

Rowland's prime-generating recurrence relation
The section gives the formula for Rowland's prime-generating sequence, with the first term a1 set to 7, the first differences of which give "1, 1, 1, 5, 3, 1, 1, 1, 1, 11, 3, 1, ..." . It then goes on to explain that this sequence will not produce 2.

However, via the OEIS page for A132199 I came upon, which is the same idea but with a1 set to 4. It is observed that this sequence is identical to A132199 (a1=7), except for the first two terms: A134734 (a1=4) starts with "2, 3, 1, 5, 3, 1, 1, 1, 1, 11, 3, 1, ...". The base sequence (, "4, 6, 9, 10, 15, 18, ...") from which the differences are calculated is identical to the base sequence of the a1=7 case ("7, 8, 9, 10, 15, 18, ...") after the first two indices, and there's no offset in the subscript n (a3=9 in both, etc).

So, is there a particular reason why this article explains the a1=7 case and its lack of 2, instead of the a1=4 case, which starts with 2? I can see merits for both cases, I'm just curious whether there's a reason for this. oatco (talk) 21:35, 22 May 2022 (UTC)


 * there are superior algorithms akin to Rowland's, at least in terms of distinct primes found in X evaluated terms, as well as computing speed. Several are at the OEIS, A135508 is one, another was just published by Bouras https://easychair.org/publications/preprint/k83H Billymac00 (talk) 00:20, 27 August 2022 (UTC)

comments on diophantine equations
I suggest to state that the solution is in non-negative integers rather than in natural numbers, as M. says in his article (also because the link gives TWO different definitions of natural numbers).

I suppose that no solutions are known; if true I would feel more relaxed (excuse my poor english) in reading this explicitly.

The text says that the set may be in 9 variables, then says that the polynomial is in 10 variables. Surely it is right because refer to different items, but it is possible to be more explicit on these two items?

Thanks. Pietro. 151.29.150.78 (talk) 15:25, 16 January 2023 (UTC)


 * ✅. This seems pretty obvious, since the nonnegative integers are referred to later in the section. Thank you for pointing this out.—Anita5192 (talk) 17:08, 16 January 2023 (UTC)

what does efficiently computable mean in this context?
The article lead says no formula for computing primes is known which is efficiently computable. What does "efficiently computable" mean in this context? The linked article lists a bunch of asymptotic classes, but it doesn't say which classes count as "efficiently computable". Does it mean not formula computable in polynomial time? -lethe talk [ +] contribs 18:39, 9 May 2023 (UTC)

Plouffe's formulas
Plouffe's formulas are conjectural and have not been proven. Does this section really belong here? MathPerson (talk) 16:59, 19 July 2023 (UTC)


 * Since no practical formula has been found and this section is sourced, I think it should stay.—Anita5192 (talk) 17:10, 19 July 2023 (UTC)

Diophantine represenatation
Is the polynomial at https://en.wikipedia.org/wiki/Formula_for_primes#Formula_based_on_a_system_of_Diophantine_equations correct? It looks like it has (k+2)as a factor, and the other factor, while lengthy, has no divisions, so is necessarily an integer also. Gordon Findlay (talk) 02:00, 17 June 2024 (UTC)


 * Note that it says that the integer $$(k+2)$$ is prime if and only if $$ (k+2)(1-\alpha_0^2-\alpha_1^2-\cdots-\alpha_{13}^2) > 0$$. (Actually, when this happens and the expression $$(k+2)(1-\alpha_0^2-\alpha_1^2-\cdots-\alpha_{13}^2)$$ is strictly positive, it means that each $$\alpha_i$$ is $$0$$, so the expression will be equal to $$(k+2)$$, the prime number.) Shreevatsa (talk) 04:16, 17 June 2024 (UTC)