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.

A162943 a(n) = 2^(1-A002321(n)).

Original entry on oeis.org

1, 2, 4, 4, 8, 4, 8, 8, 8, 4, 8, 8, 16, 8, 4, 4, 8, 8, 16, 16, 8, 4, 8, 8, 8, 4, 4, 4, 8, 16, 32, 32, 16, 8, 4, 4, 8, 4, 2, 2, 4, 8, 16, 16, 16, 8, 16, 16, 16, 16, 8, 8, 16, 16, 8, 8, 4, 2, 4, 4, 8, 4, 4, 4, 2, 4, 8, 8, 4, 8, 16, 16, 32, 16, 16, 16, 8
Offset: 1

Views

Author

Mats Granvik, Jul 18 2009

Keywords

Crossrefs

Cf. A002321, first column of A162944.

Programs

  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A162943(n):
        if n == 0:
            return 2
        c, j = n, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(4-len(bin(A162943(k1))))
            j, k1 = j2, n//j2
        return 2**(1+c-j) # Chai Wah Wu, Mar 30 2021