login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A334992
a(n) is the smallest number larger than a(n-1) whose a(i)-th binary digit is 0 for all i<n, with a(1)=1.
2
1, 4, 5, 8, 9, 12, 13, 64, 65, 68, 69, 72, 73, 76, 77, 128, 129, 132, 133, 136, 137, 140, 141, 192, 193, 196, 197, 200, 201, 204, 205, 1024, 1025, 1028, 1029, 1032, 1033, 1036, 1037, 1088, 1089, 1092, 1093, 1096, 1097, 1100, 1101, 1152
OFFSET
1,2
COMMENTS
If n=Sum_{i=0..t} 2^(k_i) is the binary representation of n, then a(n)=Sum_{i=0..t} 2^(A335033(k_i)) is the binary representation of a(n).
The first 2^n-1 terms are the nonzero partial sums of 2^(A335033(1)), 2^(A335033(2)), ..., 2^(A335033(n)).
2^n is in the sequence if and only if n isn't in the sequence. More specifically, 2^a(n) is not in the sequence, while 2^(A335033(n))=a(2^n).
Let F(n) be the number of terms in the sequence among 0,1,2,..,n-1. Then F(2^n)=2^(n-F(n)).
F(n)/n seems to be (1/n)^(1/log(n))^(1/loglog(n))^(1/logloglog(n))^... asymptotically (all logs are base 2).
FORMULA
a(Sum_{i=0..t} 2^(k_i)) = Sum_{i=0..t} 2^(A335033(k_i)) (when k_i are distinct nonnegative integers)
EXAMPLE
a(2)=4 because 4 is the smallest number > 1 whose 1st binary digit is 0.
a(6)=12 because 12 is the smallest number > 9 whose 1st, 4th, 5th, 8th, and 9th binary digits are all 0.
PROG
(Python)
def gen():
""" Generates the terms of A334992, starting with 1 """
A334992 = [0]
A335033 = [0]
while True:
new_power = 2**A335033[-1]
for i in range(len(A334992)):
A334992.append(A334992[i] + new_power)
yield A334992[i] + new_power
next_compl_elem = A335033[-1] + 1
while next_compl_elem in A334992:
next_compl_elem += 1
A335033.append(next_compl_elem)
def A334992_list(n):
""" Returns the n first elements as a list """
g = gen()
return [next(g) for _ in range(n)]
CROSSREFS
Complement of A335033.
Sequence in context: A126001 A321333 A333384 * A269984 A188085 A316097
KEYWORD
nonn,base,easy
AUTHOR
Alon Heller, May 20 2020
STATUS
approved