A354775 Indices where A354169 is the sum of two consecutive powers of 2.
5, 9, 25, 37, 49, 67, 73, 91, 97, 145, 193, 289, 385, 577, 769, 1153, 1537, 2305, 3073, 4609, 6145, 9217, 12289, 18433, 24577, 36865, 49153, 73729, 98305, 147457, 196609, 294913, 393217, 589825, 786433, 1179649, 1572865, 2359297, 3145729, 4718593, 6291457
Offset: 1
Keywords
Links
- Rémy Sigrist, C++ program
Programs
-
Python
from itertools import count, islice from collections import deque from functools import reduce from operator import or_ def A354775_gen(): # generator of terms aset, aqueue, b, f, i = {0,1,2}, deque([2]), 2, False, 2 while True: for k in count(1): m, j, j2, r, s = 0, 0, 1, b, k while r > 0: r, q = divmod(r,2) if not q: s, y = divmod(s,2) m += y*j2 j += 1 j2 *= 2 if s > 0: m += s*2**b.bit_length() if m not in aset: i += 1 if '11' in (s := bin(m)[2:]) and s.count('1') == 2: yield i aset.add(m) aqueue.append(m) if f: aqueue.popleft() b = reduce(or_,aqueue) f = not f break A354775_list = list(islice(A354775_gen(),15)) # Chai Wah Wu, Jun 27 2022
Extensions
More terms from Rémy Sigrist, Jun 27 2022
Comments