%I #14 Feb 13 2023 08:57:34
%S 0,1,3,6,2,10,7,5,15,13,11,9,21,20,4,18,2,16,14,28,12,28,12,26,8,24,
%T 22,20,36,21,19,37,21,17,35,17,33,13,31,11,29,27,45,11,31,9,29,27,47,
%U 31,7,27,25,45,7,27,23,43,23,41,19,39,17,37,35,55,22,42,18
%N Irregular triangle (an infinite binary tree) read by rows: see Comments section for definition.
%C The binary tree has root node 0, in row n=0. The left child is m - n and the right child is m + n, where m is the parent node and n is the row of the child. A given node will only have a child if the child is nonnegative and the value of the child is not present in the path from the parent to the root, including the root value itself.
%C The n-th row will have A321535(n) nodes. The rightmost border is A000217.
%H Rémy Sigrist, <a href="/A360255/b360255.txt">Table of n, a(n) for n = 0..9517</a> (rows for n = 0..21 flattened)
%e The binary tree starts with root 0 in row n = 0. In row n = 3, the parent node m = 3 does not have a left child since 3 - 3 = 0 is included in the path from the parent to the root {3,1,0}.
%e The tree begins:
%e row
%e [n]
%e [0] 0
%e \
%e [1] 1
%e \
%e [2] 3
%e \
%e [3] __6__
%e / \
%e [4] 2 10
%e \ / \
%e [5] 7 5 15
%o (MATLAB)
%o function a = A360255( max_row )
%o p = 0; a = 0; pos = 1;
%o for n = 1:max_row
%o for k = pos:length(a)
%o h =[]; o = p(k);
%o while o > 0
%o h = [h a(o)]; o = p(o);
%o end
%o if a(k)-n > 0
%o if isempty(find(h == a(k)-n, 1))
%o p = [p k]; a = [a a(k)-n];
%o end
%o end
%o if isempty(find(h == a(k)+n, 1))
%o p = [p k]; a = [a a(k)+n];
%o end
%o end
%o pos = k+1;
%o end
%o end % _Thomas Scheuerle_, Jan 31 2023
%Y Cf. A000217, A141001, A141002, A321535, A360173.
%K nonn,tabf
%O 0,3
%A _John Tyler Rascoe_, Jan 30 2023