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.

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.

This page as a plain text file.
%I A368400 #18 Dec 28 2023 15:04:13
%S A368400 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,
%T A368400 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,
%U A368400 12,16,18,22,26,32,58,59,53,60,48,49,54,61,40,41,37,42,45
%N 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.
%C A368400 Row n is a permutation of the integers in the interval [1, 2^n].
%C A368400 See A367508 for the description of the Christmas tree patterns, references and links.
%H A368400 Paolo Xausa, <a href="/A368400/b368400.txt">Table of n, a(n) for n = 1..8190</a> (rows 1..12 of the triangle, flattened).
%e A368400 Triangle begins:
%e A368400 .
%e A368400   n\k|  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
%e A368400   --------------------------------------------------------
%e A368400    1 |  1  2
%e A368400    2 |  2  3  1  4
%e A368400    3 |  5  6  3  7  1  2  4  8
%e A368400    4 | 12 13  9 14  6  7 10 15  2  3  1  4  5  8 11 16
%e A368400   ...
%e A368400 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):
%e A368400 .
%e A368400       100 101     |   4 5   |   1 2
%e A368400       010 110     |   2 6   |   3 4
%e A368400   000 001 011 111 | 0 1 3 7 | 5 6 7 8
%e A368400 .
%e A368400 The position of the elements within the pattern is therefore the following:
%e A368400 .
%e A368400   Element:  0  1  2  3  4  5  6  7
%e A368400             |  |  |  |  |  |  |  |
%e A368400             V  V  V  V  V  V  V  V
%e A368400   Position: 5  6  3  7  1  2  4  8
%e A368400 .
%t A368400 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}];
%t A368400 With[{nmax=6},Map[Flatten[Values[KeySort[PositionIndex[Flatten[#]]]]]&,A367562list[nmax]]]
%Y A368400 Cf. A367508, A367562, A368399.
%K A368400 nonn,base,tabf,look
%O A368400 1,2
%A A368400 _Paolo Xausa_, Dec 23 2023