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.
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, 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, 4, 6, 2, 4, 4, 6, 4, 6, 6, 8, 1, 3, 1, 3, 3, 5, 1, 3, 1
Offset: 0
Examples
Triangle begins: n=0: 1; n=1: 2; n=2: 1, 3; n=3: 2, 2, 4; n=4: 1, 3, 1, 3, 3, 5; n=5: 2, 2, 4, 2, 2, 4, 2, 4, 4, 6; n=6: 1, 3, 1, 3, 3, 5, 1, 3, 1, 3, 3, 5, 1, 3, 3, 5, 3, 5, 5, 7; ... 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. The tree begins: row [n] [0] 1 \ [1] _________2_________ / \ [2] 1 _____3_____ \ / \ [3] __2__ __2__ __4__ / \ / \ / \ [4] 1 3 1 3 3 5 \ / \ \ / \ / \ / \ [5] 2 2 4 2 2 4 2 4 4 6 .
Links
- Paolo Xausa, Table of n, a(n) for n = 0..13494 (rows 0..15 of the triangle, flattened).
Crossrefs
Programs
-
Mathematica
SubstitutionSystem[{1->{2},t_/;t>1:>{t-1,t+1}},{1},8] (* Paolo Xausa, Dec 23 2023 *)
-
Python
def A363718_rowlist(root,row): A = [[root]] for i in range(0,row): A.append([]) for j in range(0,len(A[i])): if A[i][j] != 1: A[i+1].append(A[i][j]-1) A[i+1].append(A[i][j]+1) return(A) A363718_rowlist(1, 8)
Comments