Skip to main content

A python approach to GOLDBACH’S CONJESTURE

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

Popular posts from this blog

Internship day 23

ശനിയാഴ്ച ക്ലാസ്സ്‌ വെക്കുന്നത് കുട്ടികൾക്കു ആരോചകമാണെങ്കിലും ട്രെയിനിങ് ടീച്ചേർസ് നു അത് ആശ്വാസമാണ്.

ഓഫ് ലൈൻ ക്ലാസ് അവസാനിക്കുന്നു

 ഇന്ന് വളരെ പ്രത്യേകതകളുള്ള ഒരു ദിവസമായിരുന്നു. കുറച്ചു നാളുകളായി ഉള്ള ഓഫ്‌ലൈൻ ക്ലാസ്സുകൾക്ക് ഇന്ന് അവസാന ദിനം.  നാളെ മുതൽ ക്ലാസുകൾ എല്ലാം ഓൺലൈൻ ആണ്. അതുകൊണ്ടൊക്കെ ആയിരിക്കണം ഇന്ന് സ്കൂളിൽ പൊതുവേ കുട്ടികൾ കുറവായിരുന്നു. മാത്രമല്ല ഇന്ന് സ്കൂളിൽ ലിറ്റിൽ കൈറ്റ്സ് ക്യാമ്പ് ഉണ്ടായിരുന്നു. പകുതിയിലേറെ കുട്ടികളും ആ ക്യാമ്പിൽ അറ്റൻഡ് ചെയ്യാൻ പോയിരുന്നു.  എനിക്കും ആ ക്യാമ്പ്  കാണാൻ സാധിച്ചു.  ഇന്ന് ഒരു പിരീഡ് എനിക്ക് ഫ്രീ പിരീഡ് ക്ലാസ് കിട്ടി 9A Polynomials Concept Attainment Model  കുട്ടികളെല്ലാവരും ക്യാമ്പിന് പോകാൻ തയ്യാറായി ഇരുന്നത് ആയിരുന്നെങ്കിലും പോലും എല്ലാവരും തന്നെ ആക്ടീവായി ക്ലാസിൽ പങ്കെടുത്തു.