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.

A022329 Exponent of 3 (value of j) in n-th number of form 2^i*3^j (see A003586).

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a022329 n = a022329_list !! (n-1)
    -- Where a022329_list is defined in A022328.
    -- Reinhard Zumkeller, Nov 19 2015, May 16 2015
    
  • Mathematica
    IntegerExponent[Select[Range[10^5], # == 2^IntegerExponent[#, 2] * 3^IntegerExponent[#, 3] &], 3] (* Amiram Eldar, Apr 15 2024 *)
  • Python
    from sympy import integer_log
    def A022329(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 integer_log((m:=bisection(f,n,n))>>(~m&m-1).bit_length(),3)[0] # Chai Wah Wu, Sep 15 2024

Formula

a(n) = A069352(n) - A022328(n). - Reinhard Zumkeller, May 16 2015
A003586(n) = 2^A022328(n) * 3^a(n). - N. J. A. Sloane, Mar 19 2009
a(n) = A191476(n) - 1. - Franklin T. Adams-Watters, Mar 19 2009

Extensions

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