|
|
A354141
|
|
Indices of terms in A352808 that are powers of 2.
|
|
2
|
|
|
1, 2, 3, 5, 9, 22, 31, 61, 121, 247, 479, 951, 1862, 3802, 7431, 15180, 29723, 59766, 118893, 239999, 475573, 959341, 1902293, 3835229, 7609175, 15268473, 30436701, 61001391
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Every power of 2 will eventually appear in A353730, so the sequence is infinite.
|
|
LINKS
|
|
|
PROG
|
(Python)
from itertools import count, islice
def ispow2(k): return bin(k).count("1") == 1
def agen(): # generator of terms
A352808lst = [0, 1]; A352808set = {0, 1}
k, mink, p = 1, 2, 2
for n in count(2):
if ispow2(k): yield n-1
ahalf, k = A352808lst[n//2], mink
while k in A352808set or k&ahalf: k += 1
A352808lst.append(k); A352808set.add(k)
while mink in A352808set: mink += 1
(C++) See Links section.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|