Answers for "get prime number sequence"

0

get prime number sequence

primeness = 0
primes = []
limit = 100000

for i in range(2, limit):
    if len(primes) != 0:
        for p in primes:
            a = i / p
            if float(a) != int(a):
                primeness += 1
                if primeness == len(primes):
                    print(i)
                    primes.append(i)
                    primeness = 0
                    break
            else:
                primeness = 0
                break
    else:
        print(i)
        primes.append(i)
Posted by: Guest on September-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language