|
|
A360656
|
|
Least k such that the decimal representation of 2^k contains all possible n-digit strings.
|
|
1
|
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|