A377463 Numbers that are not the sum of distinct powers of 4.
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
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))
Comments