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.

A219835 Number of terms of 2^j + 3^k <= 10^n.

Original entry on oeis.org

7, 29, 64, 118, 181, 254, 354, 453, 565, 708, 878, 1033, 1224, 1403, 1594, 1828, 2046, 2274, 2553, 2808, 3139, 3467, 3765, 4073, 4443, 4779, 5124, 5537, 5911, 6294, 6690, 7266, 7693, 8129, 8650, 9114, 9588, 10153, 10654, 11167, 11776, 12449, 13005, 13662, 14243
Offset: 1

Views

Author

Zak Seidov, Nov 29 2012

Keywords

Comments

As n-> infinity, a(n) -> log_2(n)*log_3(n).

Crossrefs

Cf. A004050 (numbers of the form 2^j + 3^k).

Programs

  • Mathematica
    Join[{7, 29}, Table[m = 10^x; -4 + Floor [ Log[3, m ]] + Sum[Floor @ Log[2, m - 3^i], {i, 0, Log[3, m]}], {x, 3, 100}]]
  • Python
    def a(n):
        s, pow3, lim = set(), 1, 10**n
        while pow3 < lim:
            for j in range((lim-pow3).bit_length()):
                s.add(2**j + pow3)
            pow3 *= 3
        return len(s)
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jul 29 2021