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 A360173 #30 Apr 16 2025 09:04:21 %S A360173 0,1,3,0,6,4,2,10,9,7,5,15,3,15,1,13,11,9,21,10,8,22,8,6,20,4,18,2,16, %T A360173 14,28,2,18,0,16,14,30,0,16,14,12,28,12,10,26,10,8,24,6,22,20,36,11,9, %U A360173 27,9,7,25,5,23,21,39,9,7,25,5,23,3,21,19,37,3,21 %N A360173 Irregular triangle (an infinite binary tree) read by rows. The tree has root node 0, in row n=0. Each node then has left child m - n if nonnegative and right child m + n. Where m is the value of the parent node and n is the row of the children. %C A360173 A node will have a left child only if the value of that child is greater than or equal to 0. But, each node will have a right child, since adding n will always be greater than 0. %C A360173 The n-th row will have A141002(n) nodes. The leftmost border is A008344 and the rightmost is A000217. %H A360173 Rémy Sigrist, <a href="/A360173/b360173.txt">Table of n, a(n) for n = 0..9395</a> (rows for n = 0..17 flattened) %e A360173 The binary tree starts with root 0 in row n = 0. In row n = 3, the parent node m = 3 has the first left child since 3 - 3 >= 0. %e A360173 The tree begins: %e A360173 row %e A360173 [n] %e A360173 [0] 0 %e A360173 \ %e A360173 [1] 1 %e A360173 \ %e A360173 [2] ___3___ %e A360173 / \ %e A360173 / \ %e A360173 [3] 0 __6__ %e A360173 \ / \ %e A360173 [4] 4 2 10 %e A360173 \ \ / \ %e A360173 [5] 9 7 5 15 %p A360173 T:= proc(n) option remember; `if`(n=0, 0, map(x-> %p A360173 [`if`(x<n, [][], x-n), x+n][], [T(n-1)])[]) %p A360173 end: %p A360173 seq(T(n), n=0..10); # _Alois P. Heinz_, Jan 30 2023 %t A360173 row[n_] := Module[{r = {0}}, For[h = 1, h <= n, h++, r = Flatten[If[#-h >= 0, {#-h, #+h}, {#+h}]& /@ r]]; r]; %t A360173 Table[row[n], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Apr 16 2025, after _Rémy Sigrist_ *) %o A360173 (Python) %o A360173 def A360173_rowlist(row_n): %o A360173 A = [[0]] %o A360173 for i in range(0,row_n): %o A360173 A.append([]) %o A360173 for j in range(0,len(A[i])): %o A360173 x = A[i][j] %o A360173 if x - i -1 >= 0: %o A360173 A[i+1].append(x-i-1) %o A360173 if x + i + 1 >= 0: %o A360173 A[i+1].append(x+i+1) %o A360173 return(A) %o A360173 (PARI) row(n) = { my (r=[0]); for (h=1, n, r=concat(apply(v->if (v-h>=0, [v-h,v+h], [v+h]), r))); return (r) } \\ _Rémy Sigrist_, Jan 31 2023 %Y A360173 Cf. A000217, A008344, A141001, A141002. %Y A360173 Row sums give A360229. %K A360173 nonn,look,tabf,easy %O A360173 0,3 %A A360173 _John Tyler Rascoe_, Jan 28 2023