Part A
y = 1
z = 3
while (y < 1000):
x = z/2
while (x > 1):
if z % x == 0:
z = z + 2
x = z / 2
else: x = x - 1
y = y + 1
z = z + 2
print z - 2
Part B
import math
x = 3
y = 1
z = int (raw_input("Please Enter a Number"))
u = math.log(2)
while x < z:
v = 3
while (v < math.sqrt(x) and x%v <> 0):
v = v + 2
if v > math.sqrt(x):
u = u + math.log(x)
x = x + 2
print u
print x
w = u / x
print w