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.

A063565 Smallest positive number k such that 2^k contains n.

Original entry on oeis.org

10, 4, 1, 5, 2, 8, 4, 15, 3, 12, 10, 40, 7, 17, 18, 21, 4, 27, 30, 13, 11, 18, 43, 41, 10, 8, 18, 15, 7, 32, 22, 17, 5, 25, 27, 25, 16, 30, 14, 42, 12, 22, 19, 22, 18, 28, 42, 31, 11, 32, 52, 9, 19, 16, 25, 16, 8, 20, 33, 33, 23, 58, 18, 14, 6, 16, 46, 24, 15, 34, 29, 21, 17, 30
Offset: 0

Views

Author

Robert G. Wilson v, Aug 10 2001

Keywords

Examples

			a(7) = 15 because 2^15 = 32768.
		

Crossrefs

Apart from initial term, a duplicate of A030000.

Programs

  • Mathematica
    a = {}; Do[k = 1; While[ StringPosition[ ToString[2^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
  • Python
    def A063565(n):
        s, k, k2 = str(n), 1, 2
        while True:
            if s in str(k2):
                return k
            k += 1
            k2 *= 2 # Chai Wah Wu, Jun 20 2015

Extensions

More terms from Hans Havermann