def p2find(s):
    x = [1]
for y in range(10000):
    if s in str(x[-1]) + ''.join(('00000000' + str(y))[-8:] for y in x[::-1
        ][1:]):
        return y
double(x)
return None
Finding digits in powers of 2 fast