import math

N = [500, 5000, 50000, 100000]
all = []
for n in N:
    tmp = []
    result = 0.0
    for i in range(1, 100):
        power = math.log(n, 2) - 1 - math.floor(math.log(i, 2))
        result += math.pow(2, power)
        tmp.append(result)
    all.append(tmp)

fdOut = open('curve.txt', 'w')  

for i in range(len(all)):
    for j in range(len(all[i])):
        fdOut.write(str(all[i][j]) + '\t')
    fdOut.write('\n')
fdOut.close()

