logsum = 0
n = input(
    'This is a logarithm ratio tester. Which number do you want to test? ')
for x in range(2, n):
    for divisor in range(2, 1 + int(sqrt(x + 1))):
        if x % divisor == 0:
            break
else:
    logsum += log(x)
Python 2.5.4: how to find sum of logarithm values