login
A368400
Irregular triangle read by rows: T(n,k) is the position of k within the Christmas tree pattern (A367562) of order n, with n >= 1 and k >= 0.
4
1, 2, 2, 3, 1, 4, 5, 6, 3, 7, 1, 2, 4, 8, 12, 13, 9, 14, 6, 7, 10, 15, 2, 3, 1, 4, 5, 8, 11, 16, 27, 28, 23, 29, 19, 20, 24, 30, 13, 14, 11, 15, 17, 21, 25, 31, 5, 6, 3, 7, 1, 2, 4, 8, 9, 10, 12, 16, 18, 22, 26, 32, 58, 59, 53, 60, 48, 49, 54, 61, 40, 41, 37, 42, 45
OFFSET
1,2
COMMENTS
Row n is a permutation of the integers in the interval [1, 2^n].
See A367508 for the description of the Christmas tree patterns, references and links.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..8190 (rows 1..12 of the triangle, flattened).
EXAMPLE
Triangle begins:
.
n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
--------------------------------------------------------
1 | 1 2
2 | 2 3 1 4
3 | 5 6 3 7 1 2 4 8
4 | 12 13 9 14 6 7 10 15 2 3 1 4 5 8 11 16
...
For example, the order 3 of the Christmas tree pattern is the following (binary on the left, converted to decimal in the middle, position within the pattern on the right):
.
100 101 | 4 5 | 1 2
010 110 | 2 6 | 3 4
000 001 011 111 | 0 1 3 7 | 5 6 7 8
.
The position of the elements within the pattern is therefore the following:
.
Element: 0 1 2 3 4 5 6 7
| | | | | | | |
V V V V V V V V
Position: 5 6 3 7 1 2 4 8
.
MATHEMATICA
A367562list[imax_]:=Map[FromDigits[#, 2]&, NestList[Map[Delete[{If[Length[#]>1, Map[#<>"0"&, Rest[#]], Nothing], Join[{#[[1]]<>"0"}, Map[#<>"1"&, #]]}, 0]&], {{"0", "1"}}, imax-1], {3}];
With[{nmax=6}, Map[Flatten[Values[KeySort[PositionIndex[Flatten[#]]]]]&, A367562list[nmax]]]
CROSSREFS
KEYWORD
nonn,base,tabf,look
AUTHOR
Paolo Xausa, Dec 23 2023
STATUS
approved