To be honest I'm not sure what you are looking for. Do you want the program to try various values of x and see if n is an integer?
I've not used the maths module for python so I don't know how you'd go about entering your formula but you need a loop like this
Code:
for x in range(1,10001):
n = log[base2]((7^(x)-1)/(2^(x)-1))= log[base2](7^(x)-1) - log[base2](2^(x)-1)
if n-int(n) == 0:
print x
unfortunately there is a problem with rounding error on floating point arithmetic ie if your function returns a value of 4.99999999999999999999 python will evaluate this to be 5.0 meaning the logic in the if statement above would return true. I'm not sure if there is a way round this problem.
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum