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.

This page as a plain text file.
%I A377463 #11 Oct 31 2024 01:14:49
%S A377463 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,
%T A377463 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,
%U A377463 56,57,58,59,60,61,62,63,66,67,70,71,72,73,74,75,76,77,78
%N A377463 Numbers that are not the sum of distinct powers of 4.
%C A377463 Complement of the Moser-de Bruijn sequence (A000695).
%C A377463 Numbers whose base 4 digits contain either 2 or 3.
%o A377463 (Python)
%o A377463 from gmpy2 import digits
%o A377463 def A377463(n):
%o A377463     def f(x):
%o A377463         s = digits(x,4)
%o A377463         for i in range(l:=len(s)):
%o A377463             if s[i]>'1':
%o A377463                 break
%o A377463         else:
%o A377463             return n+int(s,2)
%o A377463         return n-1+(int(s[:i] or '0',2)+1<<l-i)
%o A377463     m, k = n, f(n)
%o A377463     while m != k: m, k = k, f(k)
%o A377463     return m
%o A377463 (Python)
%o A377463 from itertools import count, islice
%o A377463 from gmpy2 import digits
%o A377463 def is_A377463(n): return max(digits(n,4))>'1'
%o A377463 def A377463_gen(): # generator of terms
%o A377463     return filter(is_A377463,count(1))
%o A377463 A377463_list = list(islice(A377463_gen(),50))
%Y A377463 Cf. A000695, A074940 (base 3 analog), A136399 (base 10 analog).
%K A377463 nonn,easy
%O A377463 1,1
%A A377463 _Chai Wah Wu_, Oct 29 2024