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.

A350802 a(n) is the sum of the numbers k < n such that a(k) AND n = a(k) (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A350802 #26 Mar 01 2022 14:51:13
%S A350802 0,0,1,3,1,7,1,21,1,21,1,34,1,43,1,65,1,73,1,94,1,127,1,157,1,157,1,
%T A350802 186,1,227,1,265,1,273,12,287,1,309,12,328,1,349,12,376,115,463,126,
%U A350802 495,1,397,12,411,1,465,12,484,1,505,12,532,277,797,288,829,1
%N A350802 a(n) is the sum of the numbers k < n such that a(k) AND n = a(k) (where AND denotes the bitwise AND operator).
%C A350802 The definition is recursive: a(n) depends on prior terms (a(0), ..., a(n-1)); a(0) = a(1) = 0 correspond to empty sums.
%H A350802 Rémy Sigrist, <a href="/A350802/b350802.txt">Table of n, a(n) for n = 0..10000</a>
%e A350802 The first terms, alongside the corresponding k's, are:
%e A350802   n   a(n)  k's
%e A350802   --  ----  -------------------------
%e A350802    0     0  {}
%e A350802    1     0  {0}
%e A350802    2     1  {0, 1}
%e A350802    3     3  {0, 1, 2}
%e A350802    4     1  {0, 1}
%e A350802    5     7  {0, 1, 2, 4}
%e A350802    6     1  {0, 1}
%e A350802    7    21  {0, 1, 2, 3, 4, 5, 6}
%e A350802    8     1  {0, 1}
%e A350802    9    21  {0, 1, 2, 4, 6, 8}
%e A350802   10     1  {0, 1}
%e A350802   11    34  {0, 1, 2, 3, 4, 6, 8, 10}
%e A350802   12     1  {0, 1}
%p A350802 a:= proc(n) option remember; add(
%p A350802      `if`(Bits[And](n, a(j))=a(j), j, 0), j=0..n-1)
%p A350802     end:
%p A350802 seq(a(n), n=0..80);  # _Alois P. Heinz_, Feb 28 2022
%o A350802 (PARI) for (n=1, #a=vector(65), print1 (a[n]=sum(k=1, n-1, if (bitand(a[k], n-1)==a[k], k-1, 0))", "))
%Y A350802 Cf. A350677, A351887.
%K A350802 base,nonn
%O A350802 0,4
%A A350802 _Rémy Sigrist_, Feb 25 2022