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.
%I A363718 #42 Sep 20 2024 06:09:35 %S A363718 1,2,1,3,2,2,4,1,3,1,3,3,5,2,2,4,2,2,4,2,4,4,6,1,3,1,3,3,5,1,3,1,3,3, %T A363718 5,1,3,3,5,3,5,5,7,2,2,4,2,2,4,2,4,4,6,2,2,4,2,2,4,2,4,4,6,2,2,4,2,4, %U A363718 4,6,2,4,4,6,4,6,6,8,1,3,1,3,3,5,1,3,1 %N A363718 Irregular triangle read by rows. An infinite binary tree which has root node 1 in row n = 0. Each node then has left child m-1 if greater than 0 and right child m+1, where m is the value of the parent node. %C A363718 The paths through the tree represent the compositions counted in A173258 that have first part 1. %C A363718 For rows n > 1, row n starts with row n-2. %C A363718 Any positive number k will first appear in the (k-1)-th row and thereafter in rows of opposite parity to k. The number of times k will appear in row n is A053121(n,k-1). %C A363718 Row n >= 1 gives the row lengths of the Christmas tree pattern of order n (cf. A367508). - _Paolo Xausa_, Nov 26 2023 %C A363718 A new row can be generated by applying the morphism 1 -> 2, t -> {t-1,t+1} (for t > 1) to the previous row. - _Paolo Xausa_, Dec 08 2023 %H A363718 Paolo Xausa, <a href="/A363718/b363718.txt">Table of n, a(n) for n = 0..13494</a> (rows 0..15 of the triangle, flattened). %e A363718 Triangle begins: %e A363718 n=0: 1; %e A363718 n=1: 2; %e A363718 n=2: 1, 3; %e A363718 n=3: 2, 2, 4; %e A363718 n=4: 1, 3, 1, 3, 3, 5; %e A363718 n=5: 2, 2, 4, 2, 2, 4, 2, 4, 4, 6; %e A363718 n=6: 1, 3, 1, 3, 3, 5, 1, 3, 1, 3, 3, 5, 1, 3, 3, 5, 3, 5, 5, 7; %e A363718 ... %e A363718 The binary tree starts with root 1 in row n = 0. In row n = 2, the parent node 2 has the first left child since 2 - 1 > 0. %e A363718 The tree begins: %e A363718 row %e A363718 [n] %e A363718 [0] 1 %e A363718 \ %e A363718 [1] _________2_________ %e A363718 / \ %e A363718 [2] 1 _____3_____ %e A363718 \ / \ %e A363718 [3] __2__ __2__ __4__ %e A363718 / \ / \ / \ %e A363718 [4] 1 3 1 3 3 5 %e A363718 \ / \ \ / \ / \ / \ %e A363718 [5] 2 2 4 2 2 4 2 4 4 6 %e A363718 . %t A363718 SubstitutionSystem[{1->{2},t_/;t>1:>{t-1,t+1}},{1},8] (* _Paolo Xausa_, Dec 23 2023 *) %o A363718 (Python) %o A363718 def A363718_rowlist(root,row): %o A363718 A = [[root]] %o A363718 for i in range(0,row): %o A363718 A.append([]) %o A363718 for j in range(0,len(A[i])): %o A363718 if A[i][j] != 1: %o A363718 A[i+1].append(A[i][j]-1) %o A363718 A[i+1].append(A[i][j]+1) %o A363718 return(A) %o A363718 A363718_rowlist(1, 8) %Y A363718 Cf. A001405 (row lengths), A000079 (row sums). %Y A363718 Cf. A000108, A007001, A053121, A173258, A367508, A367951, A367953. %K A363718 nonn,easy,tabf %O A363718 0,2 %A A363718 _John Tyler Rascoe_, Jun 17 2023