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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

68, 975, 16963, 239697, 2994863
Offset: 1

Views

Author

Hans Havermann, Feb 15 2023

Keywords

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.
		

Crossrefs

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
Showing 1-1 of 1 results.