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.

A191475 Values of i in the numbers 2^i*3^j, i >= 1, j >= 1 (A033845).

Original entry on oeis.org

1, 2, 1, 3, 2, 4, 1, 3, 5, 2, 4, 1, 6, 3, 5, 2, 7, 4, 1, 6, 3, 8, 5, 2, 7, 4, 1, 9, 6, 3, 8, 5, 2, 10, 7, 4, 1, 9, 6, 3, 11, 8, 5, 2, 10, 7, 4, 12, 1, 9, 6, 3, 11, 8, 5, 13, 2, 10, 7, 4, 12, 1, 9, 6, 14, 3, 11, 8, 5, 13, 2, 10, 7, 15, 4, 12, 1, 9, 6, 14, 3, 11
Offset: 1

Views

Author

Zak Seidov, Aug 30 2012

Keywords

Comments

Signature sequence of log_2(3) (A020857). - R. J. Mathar, May 27 2024

Examples

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

Crossrefs

Cf. A003586 (numbers 2^i*3^j, i >= 0, j >= 0), A033845 (numbers 2^i*3^j, i >= 1, j >= 1), A191476 (values of j), A020857.

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][[1, 2]], {i, t}] (* T. D. Noe, Aug 31 2012 *)
  • Python
    from sympy import integer_log
    def A191475(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+(~(m:=bisection(f,n,n))&m-1).bit_length() # Chai Wah Wu, Sep 15 2024

Extensions

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