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.

A360302 T(n,k) is the position of the set encoded in the binary expansion of k within the shortlex order for the powerset of [n]; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.

This page as a plain text file.
%I A360302 #39 Feb 06 2023 10:18:31
%S A360302 0,0,1,0,1,2,3,0,1,2,4,3,5,6,7,0,1,2,5,3,6,8,11,4,7,9,12,10,13,14,15,
%T A360302 0,1,2,6,3,7,10,16,4,8,11,17,13,19,22,26,5,9,12,18,14,20,23,27,15,21,
%U A360302 24,28,25,29,30,31,0,1,2,7,3,8,12,22,4,9,13,23,16
%N A360302 T(n,k) is the position of the set encoded in the binary expansion of k within the shortlex order for the powerset of [n]; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.
%C A360302 In shortlex order for 2^[n] the subsets are primarily sorted by cardinality and then into lexicographical order.
%C A360302 The set encoded by k consists of the indices of 1-bits (rightmost index is 1).
%C A360302 Row n is a permutation of {0, 1, ..., 2^n-1} whose inverse is in row n of A359941.
%H A360302 Alois P. Heinz, <a href="/A360302/b360302.txt">Rows n = 0..13, flattened</a>
%H A360302 Wikipedia, <a href="https://en.wikipedia.org/wiki/Shortlex_order">Shortlex order</a>
%F A360302 T(n,A359941(n,k)) = k = A359941(n,T(n,k)).
%e A360302 The subsets of [4] listed in shortlex order (starting at position 0) are: {}, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}, {1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}, {1,2,3,4}.
%e A360302 T(4,0) = T(4,0000_2) = 0: {} is at position 0.
%e A360302 T(4,3) = T(4,0011_2) = 5: {1,2} is at position 5.
%e A360302 T(4,6) = T(4,0110_2) = 8: {2,3} is at position 8.
%e A360302 T(4,7) = T(4,0111_2) = 11: {1,2,3} is at position 11.
%e A360302 T(4,15) = T(4,1111_2) = 15: {1,2,3,4} is at position 15.
%e A360302 Triangle T(n,k) begins:
%e A360302   0;
%e A360302   0, 1;
%e A360302   0, 1, 2, 3;
%e A360302   0, 1, 2, 4, 3, 5, 6,  7;
%e A360302   0, 1, 2, 5, 3, 6, 8, 11, 4, 7, 9, 12, 10, 13, 14, 15;
%e A360302   ...
%p A360302 T:= proc(n) option remember; local h, i, l;
%p A360302       l:= map(x-> add(2^(i-1), i=x),
%p A360302          [seq(combinat[choose]([$1..n], i)[], i=0..n)]);
%p A360302       h(0):=0; for i to nops(l) do h(l[i]):= (i-1) od:
%p A360302       seq(h(i), i=0..2^n-1)
%p A360302     end:
%p A360302 seq(T(n), n=0..6);
%Y A360302 Columns k=0-1 give: A000004, A057427.
%Y A360302 Row sums give A006516(n) = A000217(A000225(n)).
%Y A360302 Row lengths are A000079.
%Y A360302 Cf. A082185, A193360, A359941.
%K A360302 nonn,look,tabf
%O A360302 0,6
%A A360302 _Alois P. Heinz_, Feb 03 2023