In [29]:
x = .0001
y = 384400000

In [30]:
import numpy as np
n = (np.log(y) - np.log(x))/np.log(2)

In [31]:
n = (np.log(y/x))/np.log(2)

In [32]:
n


Out[32]:
41.805745474760016

In [33]:
def f(n):
    return x * 2**n

In [35]:
f(n) - y


Out[35]:
1.2516975402832031e-06

In [20]:
i = 0

l = x

while i < n:
    i += 1
    l *= 2
    print('{}:\t{}'.format(i, l))


1:	0.0002
2:	0.0004
3:	0.0008
4:	0.0016
5:	0.0032
6:	0.0064
7:	0.0128
8:	0.0256
9:	0.0512
10:	0.1024
11:	0.2048
12:	0.4096
13:	0.8192
14:	1.6384
15:	3.2768
16:	6.5536
17:	13.1072
18:	26.2144
19:	52.4288
20:	104.8576
21:	209.7152
22:	419.4304
23:	838.8608
24:	1677.7216
25:	3355.4432
26:	6710.8864
27:	13421.7728
28:	26843.5456
29:	53687.0912
30:	107374.1824
31:	214748.3648
32:	429496.7296
33:	858993.4592
34:	1717986.9184
35:	3435973.8368
36:	6871947.6736
37:	13743895.3472
38:	27487790.6944
39:	54975581.3888
40:	109951162.7776
41:	219902325.5552
42:	439804651.1104

In [37]:
import matplotlib.pyplot as plt

px = np.arange(n)
py = f(px)
plt.plot(px, py)
plt.show(x)



In [ ]: