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.

A352784 a(n) = w(n - w(n)), where w(n) is the binary weight of n, A000120(n).

This page as a plain text file.
%I A352784 #17 Nov 29 2022 11:30:48
%S A352784 0,0,1,1,2,2,1,1,3,3,1,1,2,2,3,3,4,4,1,1,2,2,3,3,3,3,4,4,3,3,3,3,5,5,
%T A352784 1,1,2,2,3,3,3,3,4,4,3,3,3,3,4,4,5,5,3,3,3,3,4,4,4,4,3,3,4,4,6,6,1,1,
%U A352784 2,2,3,3,3,3,4,4,3,3,3,3,4,4,5,5,3,3,3,3,4,4,4,4,3,3,4,4,5,5,6,6,3,3,3,3,4,4,4,4
%N A352784 a(n) = w(n - w(n)), where w(n) is the binary weight of n, A000120(n).
%H A352784 Michael S. Branicky, <a href="/A352784/b352784.txt">Table of n, a(n) for n = 0..10000</a>
%F A352784 a(n) = A000120(n - A000120(n)); a(n) = A000120(A011371(n)).
%F A352784 a(n) = A280700(floor(n/2)). - _Georg Fischer_, Nov 29 2022
%e A352784 a(8) = A000120(8 - A000120(8)) = 3.
%p A352784 a:= n-> (w-> w(n-w(n)))(k-> add(i, i=Bits[Split](k))):
%p A352784 seq(a(n), n=0..120);  # _Alois P. Heinz_, May 24 2022
%t A352784 w[n_] := DigitCount[n, 2, 1]; a[n_] := w[n - w[n]]; Array[a, 100, 0] (* _Amiram Eldar_, Apr 02 2022 *)
%o A352784 (Python)
%o A352784 def w(n): return bin(n).count("1")
%o A352784 def a(n): return w(n - w(n))
%o A352784 print([a(n) for n in range(108)]) # _Michael S. Branicky_, Apr 02 2022
%Y A352784 Cf. A000120, A011371, A280700.
%K A352784 nonn,base,easy
%O A352784 0,5
%A A352784 _Ctibor O. Zizka_, Apr 02 2022