Legendre\’s Conjecture In Python

Share on facebook
Share on twitter
Share on linkedin
Share on twitter
Share on tumblr

This Python program will help you to verify Legendre\’s Conjecture.

According to Wikipedia conjecture is a conclusion or proposition based on incomplete information, for which no proof or disproof has yet been found. Conjectures such as the Riemann hypothesis or Fermat’s Last Theorem have shaped much of mathematical history as new areas of mathematics are developed in order to prove them.”

Python Program to verify Legendre\’s Conjecture

import math 
def isprime( n ):
    i = 2
    for i in range (2, int((math.sqrt(n)+1))):
        if n%i == 0:
            return False
    return True
def LC( n ):
    print ( "Primes in the range ", n*n
            , " and ", (n+1)*(n+1)
            , " are:" )
    for i in range (n*n, (((n+1)*(n+1))+1)):
            print (i)
n = 50

Leave a Comment

Your email address will not be published. Required fields are marked *