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.

A191476 Values of j in the numbers 2^i*3^j, i >= 1, j >= 1, arranged in increasing order (A033845).

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 3, 2, 1, 3, 2, 4, 1, 3, 2, 4, 1, 3, 5, 2, 4, 1, 3, 5, 2, 4, 6, 1, 3, 5, 2, 4, 6, 1, 3, 5, 7, 2, 4, 6, 1, 3, 5, 7, 2, 4, 6, 1, 8, 3, 5, 7, 2, 4, 6, 1, 8, 3, 5, 7, 2, 9, 4, 6, 1, 8, 3, 5, 7, 2, 9, 4, 6, 1, 8, 3, 10, 5, 7, 2, 9, 4, 6, 1, 8, 3
Offset: 1

Views

Author

Zak Seidov, Aug 30 2012

Keywords

Comments

This is the signature sequence of log(2)/log(3) (compare A022328). - N. J. A. Sloane, May 26 2024

Examples

			a(10) = 3 because A033845(10) = 108 = 2^2*3^3.
a(100) = 7 because A033845(100) = 59872 = 2^8*3^7.
a(1000) = 1 because A033845(1000) = 216172782113783808 = 2^56*3^1.
		

Crossrefs

Cf. A033845 (numbers 2^i*3^j), A191475 (values of i).
A022329 (= a(n)-1) is an essentially identical sequence.
See also A022328.

Programs

  • Mathematica
    mx = 1000000; t = Select[Sort[Flatten[Table[2^i 3^j, {i, Log[2, mx]}, {j, Log[3, mx]}]]], # <= mx &]; Table[FactorInteger[i][[2, 2]], {i, t}] (* T. D. Noe, Aug 31 2012 *)
  • Python
    from sympy import integer_log
    def A191476(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x,3)[0]+1))
        return 1+integer_log((m:=bisection(f,n,n))>>(~m&m-1).bit_length(),3)[0] # Chai Wah Wu, Sep 15 2024

Extensions

Edited by N. J. A. Sloane, May 26 2024