Goldbach’s conjecture
On 7 June 1742, the German mathematician Christian Goldbach wrote a letter to Leonhard Euler, in which he proposed the following conjecture.
Goldbach’s conjecture is one of the oldest and best-known unsolved problems in number theory and all of mathematics.
Every even integer greater than 2 can be expressed as the sum of two primes
What is a conjecture ?😕😕😕
A Conjecture is a conclusion or proposition based on incomplete information, for which no proof or disproof has yet been found.
Goldbach number
A Goldbach number is a positive even integer that can be expressed as the sum of two odd primes.
Since 4 is the only even number greater than 2 that requires the even prime 2 in order to be written as the sum of two primes, another form of the statement of Goldbach’s conjecture is that all even integers greater than 4 are goldbach numbers.
The conjecture has been shown to hold for all integers less than 4⨯〖10〗^18, but remains unproven considerabl effort.😵
Advantages of python
Click here 👈
Python program for finding primes to represent the conjecture.
def primes(n):
p=[]
for i in range(2,n+1):
for j in range(2,int(i**(1/2))+1):
if i%j==0:
break
else:
p.append(i)
return p
def pairs(n):
p=primes(n)
a=[]
for i in range(2,n//2+1):
if i in p and (n-i) in p:
a.append([i,n-i])
return a
n=int(input("Enter the even number: "))
print(pairs(n))
print("We can represent ",n,"as",len(pairs(n))," different sum of two primes" )
Python program to representing Goldbach’s conjecture
import matplotlib.pyplot as plt
def primes(n):
p=[]
for i in range(2,n+1):
for j in range(2,int(i**(1/2))+1):
if i%j==0:
break
else:
p.append(i)
return p
def pairs(n):
p=primes(n)
a=[]
for i in range(2,n//2+1):
if i in p and (n-i) in p:
a.append([i,n-i])
return len(a)
q=int(input("Enter the number: "))
x=[]
y=[]
for i in range(4,q,2):
x.append(i)
y.append(pairs(i))
plt.plot(x,y,"*")
plt.show()
Previous post
Comments
Post a Comment