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.

A175924 Smallest power of 2 with n repeated digits.

Original entry on oeis.org

1, 65536, 16777216, 2199023255552, 1684996666696914987166688442938726917102321526408785780068975640576
Offset: 1

Views

Author

Grant Garcia, Oct 18 2010, Oct 20 2010

Keywords

Comments

The subsequent terms are too large to display.
a(6) and a(7), 2^971 and 2^972, respectively, both of which have 293 digits; a(8), 2^8554, has 2576 digits. a(9), 2^42485, has 12790 digits.
Corresponding exponents of 2 are 0, 16, 24, 41, 220, 971, 972, 8554, 42485, 42486, 271979. [Zak Seidov, Oct 19 2010]

Examples

			a(1) is 1 because it is the first power of 2; all integers have at least one digit.
a(2) is 65536 because it is the first power of 2 with two of the same digit in a row.
a(3) is 16777216 because it is the first power of 2 with three of the same digit in a row.
		

Crossrefs

Subsequence of A000079 (powers of 2).
Cf. A045875.

Programs

  • Mathematica
    f[n_] := Block[{k = 0}, While[ !MemberQ[Length /@ Split@ IntegerDigits[2^k], n], k++ ]; 2^k]; Table[f[n], {n, 5}] (* Robert G. Wilson v, Oct 21 2010 *)
  • Python
    import math
    for N in range(1, 10):
        repdigits = 1
        n = 0
        while repdigits < N:
            n += 1
            s = str(2 ** n)
            prev = ""
            repdigits = maxrepdigits = 1
            for d in s:
                if d == prev: repdigits += 1
                else:
                    maxrepdigits = max(maxrepdigits, repdigits)
                    repdigits = 1
                prev = d
            repdigits = max(maxrepdigits, repdigits)
        print(N, 2 ** n)