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.

A064515 Write A064476(n) = 2^i(n)*3^j(n); sequence gives values of j(n).

Original entry on oeis.org

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

Views

Author

Vladeta Jovovic, Oct 07 2001, Oct 07 2001

Keywords

Crossrefs

Programs

  • ARIBAS
    function a064515(maxarg: integer); var j: integer; ar: array; begin ar := p2p3(maxarg); for j := 0 to maxarg - 1 do write(ar[j][2]," "); end; end; a064515(95);  (* For definition of function p2p3 see A064476. *)
    
  • Python
    from sympy import integer_log
    def A064515(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = 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(max(0,min((i<<1)+1,(x//3**i).bit_length())-i) for i in range(integer_log(x,3)[0]+1))
        return integer_log((m:=bisection(f,n,n))>>(m-1&~m).bit_length(),3)[0] # Chai Wah Wu, Mar 26 2025

Extensions

More terms from Klaus Brockhaus, Oct 12 2001