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.

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

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