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.

A317804 Numbers of form 2^i*12^j, with i, j >= 0.

Original entry on oeis.org

1, 2, 4, 8, 12, 16, 24, 32, 48, 64, 96, 128, 144, 192, 256, 288, 384, 512, 576, 768, 1024, 1152, 1536, 1728, 2048, 2304, 3072, 3456, 4096, 4608, 6144, 6912, 8192, 9216, 12288, 13824, 16384, 18432, 20736, 24576, 27648, 32768, 36864, 41472, 49152, 55296, 65536
Offset: 1

Views

Author

Dario Ch, Sep 01 2018

Keywords

Crossrefs

Programs

  • Mathematica
    With[{max = 10^5}, Flatten[Table[2^i*12^j, {i, 0, Log2[max]}, {j, 0, Log[12, max/2^i]}]] // Sort] (* Amiram Eldar, Mar 29 2025 *)
  • Python
    from heapq import heappush, heappop
    def sequence():
        pq = [1]
        seen = set(pq)
        while True:
            value = heappop(pq)
            yield value
            seen.remove(value)
            for x in 2 * value, 12 * value:
                if x not in seen:
                    heappush(pq, x)
                    seen.add(x)
    seq = sequence()
    finalsequence_list = [next(seq) for i in range(100)]  # Dario Ch, Sep 01 2018
    
  • Python
    from sympy import integer_log
    def A317804(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((x//12**i).bit_length() for i in range(integer_log(x,12)[0]+1))
        return bisection(f,n,n) # Chai Wah Wu, Mar 26 2025

Formula

Sum_{n>=1} 1/a(n) = 24/11. - Amiram Eldar, Mar 29 2025