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.

A351886 a(n) is the number of k < n such that a(k) AND n = 0 (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A351886 #16 Mar 01 2022 14:51:24
%S A351886 0,1,2,1,4,2,3,1,8,4,6,3,8,3,4,1,16,9,11,6,14,5,8,4,17,9,10,5,10,3,5,
%T A351886 1,32,16,21,10,24,12,15,7,26,11,17,7,16,6,11,4,39,19,20,10,24,10,11,4,
%U A351886 26,12,15,7,12,3,6,1,64,34,34,20,41,21,21,10,45,21
%N A351886 a(n) is the number of k < n such that a(k) AND n = 0 (where AND denotes the bitwise AND operator).
%C A351886 The definition is recursive: a(n) depends on prior terms (a(0), ..., a(n-1)); a(0) = 0 corresponds to an empty sum.
%H A351886 Rémy Sigrist, <a href="/A351886/b351886.txt">Table of n, a(n) for n = 0..10000</a>
%F A351886 a(2^k) = 2^k.
%e A351886 The first terms, alongside the corresponding k's, are:
%e A351886   n   a(n)  k's
%e A351886   --  ----  -------------------------
%e A351886    0     0  {}
%e A351886    1     1  {0}
%e A351886    2     2  {0, 1}
%e A351886    3     1  {0}
%e A351886    4     4  {0, 1, 2, 3}
%e A351886    5     2  {0, 2}
%e A351886    6     3  {0, 1, 3}
%e A351886    7     1  {0}
%e A351886    8     8  {0, 1, 2, 3, 4, 5, 6, 7}
%e A351886    9     4  {0, 2, 4, 5}
%e A351886   10     6  {0, 1, 3, 4, 7, 9}
%e A351886   11     3  {0, 4, 9}
%e A351886   12     8  {0, 1, 2, 3, 5, 6, 7, 11}
%p A351886 a:= proc(n) option remember; add(
%p A351886      `if`(Bits[And](n, a(j))=0, 1, 0), j=0..n-1)
%p A351886     end:
%p A351886 seq(a(n), n=0..80);  # _Alois P. Heinz_, Feb 28 2022
%o A351886 (PARI) for (n=1, #a=vector(75), print1 (a[n]=sum(k=1, n-1, bitand(a[k], n-1)==0)", "))
%o A351886 (Python)
%o A351886 a = []
%o A351886 [a.append(sum(a[k] & n == 0 for k in range(n))) for n in range(74)]
%o A351886 print(a) # _Michael S. Branicky_, Feb 24 2022
%Y A351886 Cf. A080100, A088167, A350677, A351887.
%K A351886 nonn,base
%O A351886 0,3
%A A351886 _Rémy Sigrist_, Feb 23 2022