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.

A354757 a(n) = Sum_{k = ceiling(n/2)..n-1} A354169(k).

This page as a plain text file.
%I A354757 #20 Aug 02 2022 12:15:47
%S A354757 0,0,1,2,6,12,15,27,59,115,127,252,508,1004,1021,2013,2047,4031,8127,
%T A354757 16307,16375,32631,32767,65279,130815,261375,262143,524270,1048558,
%U A354757 2096110,2097135,4194253,4194271,8386527,8388607,16773119,33550335,67096575,67108863
%N A354757 a(n) = Sum_{k = ceiling(n/2)..n-1} A354169(k).
%C A354757 The 1's in the binary expansion of a(n) are forbidden in that of A354169(n). In other words, a(n) AND A354169(n) = 0 (where AND denotes the bitwise AND operator).
%H A354757 N. J. A. Sloane, <a href="/A354757/b354757.txt">Table of n, a(n) for n = 0..4800</a>
%H A354757 Rémy Sigrist, <a href="/A354757/a354757.png">Binary plot of a(n) (blue pixels) and A354169(n) (red pixels) for n=0..1000</a>
%H A354757 Rémy Sigrist, <a href="/A354757/a354757.gp.txt">PARI program</a>
%e A354757 a(5) = A354169(3) + A354169(4) = 4 + 8 = 12.
%e A354757 a(7) = A354169(4) + A354169(5) + A354169(6) = 8 + 3 + 16 = 27.
%o A354757 (PARI) See Links section.
%o A354757 (Python)
%o A354757 from itertools import count, islice
%o A354757 from collections import deque
%o A354757 from functools import reduce
%o A354757 from operator import or_
%o A354757 def A354757_gen(): # generator of terms
%o A354757     aset, aqueue, b, f = {0,1,2}, deque([2]), 2, False
%o A354757     yield from (0,0,1)
%o A354757     while True:
%o A354757         for k in count(1):
%o A354757             m, j, j2, r, s = 0, 0, 1, b, k
%o A354757             while r > 0:
%o A354757                 r, q = divmod(r,2)
%o A354757                 if not q:
%o A354757                     s, y = divmod(s,2)
%o A354757                     m += y*j2
%o A354757                 j += 1
%o A354757                 j2 *= 2
%o A354757             if s > 0:
%o A354757                 m += s*2**b.bit_length()
%o A354757             if m not in aset:
%o A354757                 yield sum(aqueue)
%o A354757                 aset.add(m)
%o A354757                 aqueue.append(m)
%o A354757                 if f: aqueue.popleft()
%o A354757                 b = reduce(or_,aqueue)
%o A354757                 f = not f
%o A354757                 break
%o A354757 A354757_list = list(islice(A354757_gen(),40)) # _Chai Wah Wu_, Jun 06 2022
%Y A354757 Cf. A354169, A354758.
%Y A354757 A354780 is a bisection.
%K A354757 nonn,base
%O A354757 0,4
%A A354757 _Rémy Sigrist_, Jun 06 2022