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.

A069353 Numbers of form 2^i*3^j - 1 with i, j >= 0.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 8, 11, 15, 17, 23, 26, 31, 35, 47, 53, 63, 71, 80, 95, 107, 127, 143, 161, 191, 215, 242, 255, 287, 323, 383, 431, 485, 511, 575, 647, 728, 767, 863, 971, 1023, 1151, 1295, 1457, 1535, 1727, 1943, 2047, 2186, 2303, 2591, 2915, 3071, 3455, 3887
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 18 2002

Keywords

Comments

Are there infinitely many primes in this sequence? See A005105.
If m is a term then also 2*m + 1 and 3*m + 2.

Crossrefs

Programs

  • Mathematica
    With[{max = 4000}, Sort[Flatten[Table[2^i*3^j - 1, {i, 0, Log2[max]}, {j, 0, Log[3, max/2^i]}]]]] (* Amiram Eldar, Jul 13 2023 *)
  • Python
    from sympy import integer_log
    def A069353(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+1)//3**i).bit_length() for i in range(integer_log(x+1,3)[0]+1))
        return bisection(f,n-1,n-1) # Chai Wah Wu, Mar 31 2025

Formula

a(n) = A003586(n)-1.