2^7=128是前导数字为“12”的第一个2的幂。

2^80是前导数字为“12”的第一个2的幂。

``````import time as tm
import math as m
ta=tm.time()
tb=ta
lg123=m.log(1.23)/m.log(10)
lg124=m.log(1.24)/m.log(10)
a=0
for i in range(1,12800000000):
t= i*lg2-m.floor(i*lg2)
if t >= lg123 and t<lg124:
a=a+1
if(a>=678910):
tb=tm.time()
print(a,i)
print('time cost',tb-ta,'s')
break

678910 193060223
time cost 197.0109851360321 s
``````

``````幂次    差值
2515    196
2711    289
3000    196
3196    485
3681    196
3877    289
``````

``````import time as tm
import math as m
ta=tm.time()
tb=ta
lg2=m.log(2)/m.log(10)
lg123=m.log(1.23)/m.log(10)
lg124=m.log(1.24)/m.log(10)
a=0
i0=0
for i in range(1,128):
t= i*lg2-m.floor(i*lg2)
if t >= lg123 and t<lg124:
a=a+1
i0=i

while i0<12800000000:
for gap in[196,289,485]:
t= (i0+gap)*lg2-m.floor((i0+gap)*lg2)
if t >= lg123 and t<lg124:
a=a+1
i0=i0+gap
break
if(a>=678910):
tb=tm.time()
print(a,i0)
print('time cost',tb-ta,'s')
exit

678910 193060223
time cost 3.5182394981384277 s
``````

``````In[1]:= 2.0^196

59
Out[1]= 1.00434 10

In[2]:= 2.0^289

86
Out[2]= 9.94646 10

In[3]:= 2.0^485

145
Out[3]= 9.9896 10
``````

PE论坛上有人还发现196=14^2, 289=17^2,485=196+289