OFFSET
1,1
COMMENTS
Complement of the Moser-de Bruijn sequence (A000695).
Numbers whose base 4 digits contain either 2 or 3.
PROG
(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<<l-i)
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m
(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))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Chai Wah Wu, Oct 29 2024
STATUS
approved