Number Theory Inhibitor Calculator I've been working on generating primes and prime products quickly to aid me in my research on prime numbers, their density, etc. The answer to my Large Number Limit Extravaganza question proved to be extremely useful in writing my programs. I have now expanded on this program to look at the difference in the amount of primes up to a certain point according to a lower bound, and the amount of "straight inhibitors" up to a certain point. A straight inhibitor is a figment of my imagination that I have used in my math and is extremely important for it.

import math
grandtotal = 1000
def prime_sieve(limit):
    a = [True] * limit
    a[0] = a[1] = False

    for i, isprime in enumerate(a):
        if isprime:
            yield i
            for n in xrange(i * i, limit, i):
                a[n] = False

def getDotArrayLog():
    e=55
    data = []
    while e&lt;grandtotal:
        e+=1
        data.append((2 * e / (math.log(2.0 * e, 10) + 2)) - e / (math.log(e, 10) - 4))
    return data

def getDotArrayProduct():
    e=55
    data = []
    product = 1.0
    while True:
        if e==grandtotal: break
        e+=1
        for p in prime_sieve(e):
            product *= (1.0 - 1.0 / p)
        data.append(product)
        product = 1.0
    return data


if __name__ == "__main__":
    logs = getDotArrayLog()
    producta = getDotArrayProduct()
    print "Tested all the way up to", grandtotal
    counter = 0
    for e in logs:
        a = (1-producta[counter])*(counter+55)
        print "Amount of primes:", e
        print "Amount of inhibitors:", a
        print e-a
        counter+=1


I'm looking for some optimizations, condensations, and probably a great lecture on proper conventions.
2 small enhancements that I can see:

First, you could avoid to compute log(e,10) twice in each iteration by noticing that log(a*b) = log(a)+log(b). Since one term is fixed, you save 1 computation:

log2 = math.log(2.0,10)

def getDotArrayLog():
    e=55
    data = []

    while e&lt;grandtotal:
        e+=1
        loge = math.log(e, 10)  # compute once only
        data.append((2 * e / (loge + log2 + 2)) - e / (loge - 4))
    return data


then, in your final loop, you could zip both arrays instead of using a counter and index access, and use enumerate to do the index counting for you, since you still need it for your computations:

for counter,(e,p) in enumerate(zip(logs,producta)):
    a = (1-p)*(counter+55)
    print "Amount of primes:", e
    print "Amount of inhibitors:", a
    print e-a