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.

A356028 Irregular triangle {A(n, k)} read by rows, giving in row n the numbers 1, 2, ..., 2^n - 1 ordered according to increasing binary weights, and for like weights decreasing.

This page as a plain text file.
%I A356028 #27 Dec 20 2023 07:41:21
%S A356028 1,2,1,3,4,2,1,6,5,3,7,8,4,2,1,12,10,9,6,5,3,14,13,11,7,15,16,8,4,2,1,
%T A356028 24,20,18,17,12,10,9,6,5,3,28,26,25,22,21,19,14,13,11,7,30,29,27,23,
%U A356028 15,31,32,16,8,4,2,1,48,40,36,34,33,24,20,18,17,12,10,9,6,5,3,56,52,50,49,44,42,41,38,37,35,28,26,25,22,21,19,14,13,11,7,60,58,57,54,53,51,46,45,43,39,30,29,27,23,15,62,61,59,55,47,31,63
%N A356028 Irregular triangle {A(n, k)} read by rows, giving in row n the numbers 1, 2, ..., 2^n - 1 ordered according to increasing binary weights, and for like weights decreasing.
%C A356028 The length of row n is 2^n - 1 = A000225(n).
%C A356028 Also irregular triangle {A(n, k)} read by rows, giving in row n the numbers with a binary encoding of the list choose([n], m) = choose({1, 2,..., n}, m) (each encoding of length n), for n >= 1 and m = 1, 2, ..., n; written as entries for k = 1, 2, ..., 2^n - 1.
%C A356028 The binary encoding is obtained by setting 1s at the positions given by the choose([n],m) list of lists (in lexicographic order) and 0 otherwise. E.g., choose([3], 2) = [[1, 2], [1, 3], [2, 3]] with the encodings of length 3 [[1, 1, 0], [1, 0, 1], [0, 1, 1]], read as base 2 lists giving the numbers [6, 5, 3].
%C A356028 For the triangle T(n,m) of the sums of like m entries see A134346, (using offset 1).
%C A356028 The sum of row n gives A006516(n) = A171476(n-1), for n >= 1 (see A134346).
%H A356028 Paolo Xausa, <a href="/A356028/b356028.txt">Table of n, a(n) for n = 1..8178</a> (rows 1..12 of the triangle, flattened).
%e A356028 The irregular triangle A begins (commas separate the n subsequences for m = 1, 2, ..., n, corresponding to the binary encoded choose(n, m) lists or binary weights m):
%e A356028 n\k   1 2  3  4   5  6  7  8 9 10  11 12 13 14  15 ...
%e A356028 1:    1
%e A356028 2:    2 1, 3
%e A356028 3:    4 2  1, 6   5  3, 7
%e A356028 4:    8 4  2  1, 12 10  9  6 5  3, 14 13 11  7, 15
%e A356028 ...
%e A356028 n = 5: [16 8 4 2 1, 24 20 18 17 12 10 9 6 5 3, 28 26 25 22 21 19 14 13 11 7, 30 29 27 23 15, 31];
%e A356028 n = 6: [32 16 8 4 2 1, 48 40 36 34 33 24 20 18 17 12 10 9 6 5 3, 56 52 50 49 44 42 41 38 37 35 28 26 25 22 21 19 14 13 11 7, 60 58 57 54 53 51 46 45 43 39 30 29 27 23 15, 62 61 59 55 47 31, 63);
%e A356028 ...
%e A356028 A(4, 2) gives the number with the binary representation of the choose([4], 2) list [[1,1,0,0], [1,0,1,0], [1,0,0,1], [0,1,1,0], [0,1,0,1], [0,0,1,1]], obtained from the list choose([4], 2) = [[1,2], [1,3], [1,4], [2,3], [2,4], [3,4]], that is [12, 10, 9, 6, 5, 3].
%e A356028 A(4, 2) from the numbers 1, 2, ..., 15 with binary weight 2, that is of 3, 5, 6, 9, 10, 12, in decreasing order: 12, 10, 9, 6, 5, 3.
%t A356028 A356028row[n_]:=SortBy[Range[2^n-1],{DigitCount[#,2,1]&,-#&}];
%t A356028 Array[A356028row,6] (* _Paolo Xausa_, Dec 20 2023 *)
%o A356028 (PARI) cmph(x, y) = my(d=hammingweight(x)-hammingweight(y)); if (d, d, y-x);
%o A356028 row(n) = my(v=[1..2^n-1]); vecsort(v, cmph); \\ _Michel Marcus_, Sep 16 2023
%Y A356028 Cf. A000225, A006516, A134346, A171476, A262881, A294648.
%K A356028 nonn,tabf,base,look,easy
%O A356028 1,2
%A A356028 _Wolfdieter Lang_, Jul 27 2022
%E A356028 Name suggested by _Kevin Ryde_.