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.

A377463 Numbers that are not the sum of distinct powers of 4.

Original entry on oeis.org

2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78
Offset: 1

Views

Author

Chai Wah Wu, Oct 29 2024

Keywords

Comments

Complement of the Moser-de Bruijn sequence (A000695).
Numbers whose base 4 digits contain either 2 or 3.

Crossrefs

Cf. A000695, A074940 (base 3 analog), A136399 (base 10 analog).

Programs

  • Python
    from gmpy2 import digits
    def A377463(n):
        def f(x):
            s = digits(x,4)
            for i in range(l:=len(s)):
                if s[i]>'1':
                    break
            else:
                return n+int(s,2)
            return n-1+(int(s[:i] or '0',2)+1<
    				
  • Python
    from itertools import count, islice
    from gmpy2 import digits
    def is_A377463(n): return max(digits(n,4))>'1'
    def A377463_gen(): # generator of terms
        return filter(is_A377463,count(1))
    A377463_list = list(islice(A377463_gen(),50))