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.

A172404 Numbers k such that 3 is the first digit of 2^k.

Original entry on oeis.org

5, 15, 25, 35, 45, 55, 65, 75, 78, 85, 88, 95, 98, 108, 118, 128, 138, 148, 158, 168, 178, 181, 188, 191, 201, 211, 221, 231, 241, 251, 261, 271, 274, 281, 284, 291, 294, 304, 314, 324, 334, 344, 354, 364, 367, 374, 377, 384, 387, 397, 407, 417, 427, 437, 447, 457, 467, 470, 477, 480, 487, 490, 500
Offset: 1

Views

Author

David Radcliffe, Nov 20 2010

Keywords

Comments

The asymptotic density of this sequence is log_10(4/3) = 0.124938... - Amiram Eldar, Jan 27 2021

Crossrefs

Programs

  • GAP
    Filtered([1..500],n->ListOfDigits(2^n)[1]=3); # Muniru A Asiru, Oct 17 2018
    
  • Maple
    x := 1.; L := []; for n from 0 to 500 do if 3 < x and x < 4 then L := [op(L), n] end if; x := 2*x; if x > 10 then x := (1/10)*x end if end do; L;
  • Mathematica
    Select[Range[1000], IntegerDigits[2^#][[1]] == 3 &]
  • PARI
    isok(n) = digits(2^n)[1] == 3; \\ Michel Marcus, Oct 18 2018
  • Python
    ans, x = [], 1.
    for n in range(501):
        if 3 < x < 4: ans.append(n)
        x = x*2
        if x > 10: x = x / 10
    print(ans)
    
  • Python
    from itertools import islice
    def A172404_gen(): # generator of terms
        a, b, c, l = 3, 4, 1, 0
        while True:
            if a<=c:
                if cA172404_list = list(islice(A172404_gen(),30)) # Chai Wah Wu, Nov 13 2023