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.
%I A335587 #22 Apr 23 2021 01:20:22 %S A335587 0,0,1,0,6,2,1,0,28,12,10,4,6,2,1,0,120,56,52,24,44,20,18,8,28,12,10, %T A335587 4,6,2,1,0,496,240,232,112,216,104,100,48,184,88,84,40,76,36,34,16, %U A335587 120,56,52,24,44,20,18,8,28,12,10,4,6,2,1,0,2016,992,976,480 %N A335587 a(n) is the sum of the numbers k such that 0 <= k <= n and n AND k = 0 (where AND denotes the bitwise AND operator). %C A335587 All terms can be written as m * 2^A000120(m) for some m >= 0. %H A335587 Rémy Sigrist, <a href="/A335587/b335587.txt">Table of n, a(n) for n = 0..8191</a> %H A335587 Rémy Sigrist, <a href="/A335587/a335587.png">Colored logarithmic scatterplot of the sequence for n < 2^16</a> (where the color is function of A080791(n)) %H A335587 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A335587 a(n) = A035327(n) * A080100(n) / 2 for any n > 0. %F A335587 a(2*n+1) = 2*a(n). %F A335587 a(2^k-1) = 0 for any k >= 0. %F A335587 a(2^k) = A006516(k) for any k >= 0. %e A335587 For n = 4: %e A335587 - 4 AND 0 = 0, %e A335587 - 4 AND 1 = 0, %e A335587 - 4 AND 2 = 0, %e A335587 - 4 AND 3 = 0, %e A335587 - 4 AND 4 = 4, %e A335587 - so a(4) = 0 + 1 + 2 + 3 = 6. %o A335587 (PARI) a(n) = sum(k=0, n, if (bitand(n, k)==0, k, 0)) %o A335587 (PARI) a(n) = my (w=#binary(n)); ( (2^w-1-n) * 2^(w-hammingweight(n)) ) \ 2 %Y A335587 Cf. A000120, A004198 (bitwise AND), A006516, A035327, A080100, A080791. %K A335587 nonn,base %O A335587 0,5 %A A335587 _Rémy Sigrist_, Apr 21 2021