Prime Numbers formula !!
Posted: Fri Jun 19, 2015 8:51 am
i am trying to check that this formula produce prime numbers
as said by its discoverer in article "diophantine representation of the set of prime numbers":
https://www.maa.org/sites/default/files ... aWiens.pdf
and deleting the new lines we get:
then we need the Little John tool to convert '^' to PB/C Pow, http://purebasic.fr/english/viewtopic.p ... 25#p464248 so we get this:
the author said :[[ (1) is a polynomial of degree 25 in 26 variables, a, b, c,..., z. When nonnegative integers are substituted for these variables, the positive values of (1) coincide exactly with the set of all prime numbers 2,3,5,.... The polynomial (1) also takes on negative values, e.g., - 76.]]
in page 200 of the book music of the primes the author said: [[This formula works like a computer program. You randomly change the letters A, . . ., Z into numbers and then use the formula to perform a calculation on those numbers; for example, you might choose A = 1, B = 2, . . ., Z = 26. If the answer is bigger than zero, then the result of the
calculation is prime.]]

applying the second author advice: the following program does not produce positive numbers at all. another source of the formula in https://en.wikipedia.org/wiki/Formula_for_primes
so it is either the formula or the program or my understanding of the issue are wrong.
Code: Select all
(k + 2)* (1 - (w*z + h + j - q)^2 - ((g*k + 2*g + k + 1)*(h + j) + h - z)^2 - (2*n + p + q + z - e)^2
-(16*(k + 1)^3*(k + 2)*(n + 1)^2 + 1 - f^2)^2 - (e^3*(e + 2)*(a + 1)^2 + 1 - o^2)^2 - ((a^2 - 1)*y^2 + 1 - x^2)^2
-(16*r^2*y^4*(a^2 - 1) + 1 - u^2)^2 - (((a + u^2*(u^2 - a))^2 - 1)*(n + 4*d*y)^2 + 1 - (x + c*u)^2)^2 - (n + L + v - y)^2
-((a^2 - 1)*L^2 + 1 - m^2)^2 - (a*i + k + 1 - L - i)^2 - (p + L*(a - n - 1) + b*(2*a*n + 2*a - n^2 - 2*n - 2) - m)^2
-(q + y*(a - p - 1) + s*(2*a*p + 2*a - p^2 - 2*p - 2) - x)^2 - (z + p*L*(a - p) + t*(2*a*p - p^2 - 1) - p*m)^2)
https://www.maa.org/sites/default/files ... aWiens.pdf
and deleting the new lines we get:
Code: Select all
(k + 2)* (1 - (w*z + h + j - q)^2 - ((g*k + 2*g + k + 1)*(h + j) + h - z)^2 - (2*n + p + q + z - e)^2 -(16*(k + 1)^3*(k + 2)*(n + 1)^2 + 1 - f^2)^2 - (e^3*(e + 2)*(a + 1)^2 + 1 - o^2)^2 - ((a^2 - 1)*y^2 + 1 - x^2)^2 -(16*r^2*y^4*(a^2 - 1) + 1 - u^2)^2 - (((a + u^2*(u^2 - a))^2 - 1)*(n + 4*d*y)^2 + 1 - (x + c*u)^2)^2 - (n + L + v - y)^2-((a^2 - 1)*L^2 + 1 - m^2)^2 - (a*i + k + 1 - L - i)^2 - (p + L*(a - n - 1) + b*(2*a*n + 2*a - n^2 - 2*n - 2) - m)^2-(q + y*(a - p - 1) + s*(2*a*p + 2*a - p^2 - 2*p - 2) - x)^2 - (z + p*L*(a - p) + t*(2*a*p - p^2 - 1) - p*m)^2)
Code: Select all
(k+2)*(1-Pow(w*z+h+j-q,2)-Pow((g*k+2*g+k+1)*(h+j)+h-z,2)-Pow(2*n+p+q+z-e,2)-Pow(16*Pow(k+1,3)*(k+2)*Pow(n+1,2)+1-Pow(f,2),2)-Pow(Pow(e,3)*(e+2)*Pow(a+1,2)+1-Pow(o,2),2)-Pow((Pow(a,2)-1)*Pow(y,2)+1-Pow(x,2),2)-Pow(16*Pow(r,2)*Pow(y,4)*(Pow(a,2)-1)+1-Pow(u,2),2)-Pow((Pow(a+Pow(u,2)*(Pow(u,2)-a),2)-1)*Pow(n+4*d*y,2)+1-Pow(x+c*u,2),2)-Pow(n+L+v-y,2)-Pow((Pow(a,2)-1)*Pow(L,2)+1-Pow(m,2),2)-Pow(a*i+k+1-L-i,2)-Pow(p+L*(a-n-1)+b*(2*a*n+2*a-Pow(n,2)-2*n-2)-m,2)-Pow(q+y*(a-p-1)+s*(2*a*p+2*a-Pow(p,2)-2*p-2)-x,2)-Pow(z+p*L*(a-p)+t*(2*a*p-Pow(p,2)-1)-p*m,2))
in page 200 of the book music of the primes the author said: [[This formula works like a computer program. You randomly change the letters A, . . ., Z into numbers and then use the formula to perform a calculation on those numbers; for example, you might choose A = 1, B = 2, . . ., Z = 26. If the answer is bigger than zero, then the result of the
calculation is prime.]]

applying the second author advice: the following program does not produce positive numbers at all. another source of the formula in https://en.wikipedia.org/wiki/Formula_for_primes
so it is either the formula or the program or my understanding of the issue are wrong.
Code: Select all
For counter=1 To 100000
A=Random(50, 1)
B=Random(50, 1)
C=Random(50, 1)
D=Random(50, 1)
E=Random(50, 1)
F=Random(50, 1)
G=Random(50, 1)
H=Random(50, 1)
I=Random(50, 1)
J=Random(50, 1)
K=Random(50, 1)
L=Random(50, 1)
M=Random(50, 1)
N=Random(50, 1)
O=Random(50, 1)
P=Random(50, 1)
Q=Random(50, 1)
R=Random(50, 1)
S=Random(50, 1)
T=Random(50, 1)
U=Random(50, 1)
V=Random(50, 1)
W=Random(50, 1)
X=Random(50, 1)
Y=Random(50, 1)
Z=Random(50, 1)
res.q = (k+2)*(1-Pow(w*z+h+j-q,2)-Pow((g*k+2*g+k+1)*(h+j)+h-z,2)-Pow(2*n+p+q+z-e,2)-Pow(16*Pow(k+1,3)*(k+2)*Pow(n+1,2)+1-Pow(f,2),2)-Pow(Pow(e,3)*(e+2)*Pow(a+1,2)+1-Pow(o,2),2)-Pow((Pow(a,2)-1)*Pow(y,2)+1-Pow(x,2),2)-Pow(16*Pow(r,2)*Pow(y,4)*(Pow(a,2)-1)+1-Pow(u,2),2)-Pow((Pow(a+Pow(u,2)*(Pow(u,2)-a),2)-1)*Pow(n+4*d*y,2)+1-Pow(x+c*u,2),2)-Pow(n+L+v-y,2)-Pow((Pow(a,2)-1)*Pow(L,2)+1-Pow(m,2),2)-Pow(a*i+k+1-L-i,2)-Pow(p+L*(a-n-1)+b*(2*a*n+2*a-Pow(n,2)-2*n-2)-m,2)-Pow(q+y*(a-p-1)+s*(2*a*p+2*a-Pow(p,2)-2*p-2)-x,2)-Pow(z+p*L*(a-p)+t*(2*a*p-Pow(p,2)-1)-p*m,2))
If res >= 0
Debug res
Debug k+2
EndIf
;Debug a: Debug t
;Debug res
Next
Debug "end"