A360656 Least k such that the decimal representation of 2^k contains all possible n-digit strings.
68, 975, 16963, 239697, 2994863
Offset: 1
Examples
2^68 = 295147905179352825856 is the least power of 2 containing all ten decimal digits, so a(1) = 68 = A171744(1). 2^975 is the least power of 2 containing all 100 two-digit strings, so a(2) = 975.
Programs
-
Python
def a(n, starte=0): e, p2, t = starte, 2**starte, 10**n while True: s2, ss = str(p2), set() for i in range(len(s2)-n+1): ss.add(s2[i:i+n]) if len(ss) == t: return e e += 1 p2 *= 2 print([a(n) for n in range(1, 4)]) # Michael S. Branicky, Feb 22 2023