cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A360656 Least k such that the decimal representation of 2^k contains all possible n-digit strings.

This page as a plain text file.
%I A360656 #14 Feb 26 2023 20:26:57
%S A360656 68,975,16963,239697,2994863
%N A360656 Least k such that the decimal representation of 2^k contains all possible n-digit strings.
%e A360656 2^68 = 295147905179352825856 is the least power of 2 containing all ten decimal digits, so a(1) = 68 = A171744(1).
%e A360656 2^975 is the least power of 2 containing all 100 two-digit strings, so a(2) = 975.
%o A360656 (Python)
%o A360656 def a(n, starte=0):
%o A360656     e, p2, t = starte, 2**starte, 10**n
%o A360656     while True:
%o A360656         s2, ss = str(p2), set()
%o A360656         for i in range(len(s2)-n+1):
%o A360656             ss.add(s2[i:i+n])
%o A360656             if len(ss) == t:
%o A360656                 return e
%o A360656         e += 1
%o A360656         p2 *= 2
%o A360656 print([a(n) for n in range(1, 4)]) # _Michael S. Branicky_, Feb 22 2023
%Y A360656 Cf. A171744, A360623.
%K A360656 nonn,base,more
%O A360656 1,1
%A A360656 _Hans Havermann_, Feb 15 2023