cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A354775 Indices where A354169 is the sum of two consecutive powers of 2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 26 2022

Keywords

Comments

A subsequence of A354798.
The first differences begin 4, 16, 12, 12, 18, 6, 18, 6, 48, 48, 96, 96, 192, 192, 384, 384, 768, 768, 1536, ..., which suggests that from the 9th term on, the differences have g.f. 48*(1+x)/(1-2*x^2), with an analogous conjecture for the sequence itself.

Crossrefs

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