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.

A348687 Triangle read by rows, T(n, k) = n - HammingWeight(k), for 0 <= k <= n.

This page as a plain text file.
%I A348687 #7 Oct 30 2021 06:03:05
%S A348687 0,1,0,2,1,1,3,2,2,1,4,3,3,2,3,5,4,4,3,4,3,6,5,5,4,5,4,4,7,6,6,5,6,5,
%T A348687 5,4,8,7,7,6,7,6,6,5,7,9,8,8,7,8,7,7,6,8,7,10,9,9,8,9,8,8,7,9,8,8,11,
%U A348687 10,10,9,10,9,9,8,10,9,9,8
%N A348687 Triangle read by rows, T(n, k) = n - HammingWeight(k), for 0 <= k <= n.
%e A348687 Triangle starts:
%e A348687 [0] 0;
%e A348687 [1] 1, 0;
%e A348687 [2] 2, 1, 1;
%e A348687 [3] 3, 2, 2, 1;
%e A348687 [4] 4, 3, 3, 2, 3;
%e A348687 [5] 5, 4, 4, 3, 4, 3;
%e A348687 [6] 6, 5, 5, 4, 5, 4, 4;
%e A348687 [7] 7, 6, 6, 5, 6, 5, 5, 4;
%e A348687 [8] 8, 7, 7, 6, 7, 6, 6, 5, 7;
%e A348687 [9] 9, 8, 8, 7, 8, 7, 7, 6, 8, 7;
%p A348687 HammingWeight := n -> add(i, i = convert(n, base, 2)):
%p A348687 A348687 := (n, k) -> n - HammingWeight(k):
%p A348687 seq(seq(A348687(n, k), k = 0..n), n = 0..11);
%t A348687 Table[n - DigitCount[k, 2, 1], {n, 0, 11}, {k, 0, n}] // Flatten (* _Amiram Eldar_, Oct 30 2021 *)
%Y A348687 Cf. A000120, A001477, A011371, A122247 (row sums), A057427 (row gcd).
%Y A348687 Cf. A348684, A348685, A348676.
%K A348687 nonn,tabl
%O A348687 0,4
%A A348687 _Peter Luschny_, Oct 29 2021