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 A369492 #27 Apr 28 2024 16:27:19 %S A369492 1,0,2,4,8,10,16,18,22,32,34,36,38,42,46,64,66,68,70,74,76,78,86,90, %T A369492 94,128,130,132,134,136,138,140,142,146,148,150,154,156,158,170,174, %U A369492 182,186,190,256,258,260,262,264,266,268,270,274,276,278,280,282,284,286 %N A369492 Triangle read by rows. An encoding of compositions of n where the first part is the largest part and the last part is not 1. The number of these compositions (the length of row n) is given by A368279. %C A369492 The compositions are in reverse lexicographic order (see A066099). %C A369492 For n = 0 we get the empty composition, which we encode by 1. %C A369492 For n = 1 we get the no composition, which we encode by 0. %C A369492 The definition uses two filter conditions: (a) 'the last part of the composition is not 1' and (b) 'the first part is the largest part'. By changing condition (b) to (b'), 'the parts are nonincreasing', one obtains A002865. Like the current sequence, A002865 has offset 0; the empty composition is nonincreasing (a(0) = 1), and there is no composition of 1, which has a last part that is not 1 (a(1) = 0). %H A369492 Peter Luschny, <a href="https://github.com/PeterLuschny/Gists/blob/main/SageMathForA368279andA369492.ipynb">A SageMath notebook for A368279 and A369492</a>, Jan. 2024 %e A369492 Encoding the composition as an integer, a binary string, a Dyck path, and a list. %e A369492 [ n] %e A369492 [ 0] 1 | 1 | () | [()] %e A369492 [ 1] 0 | 0 | . | [] %e A369492 [ 2] 2 | 10 | (()) | [2] %e A369492 [ 3] 4 | 100 | ((())) | [3] %e A369492 [ 4] 8 | 1000 | (((()))) | [4] %e A369492 [ 5] 10 | 1010 | (())(()) | [2, 2] %e A369492 [ 6] 16 | 10000 | ((((())))) | [5] %e A369492 [ 7] 18 | 10010 | ((()))(()) | [3, 2] %e A369492 [ 8] 22 | 10110 | (())()(()) | [2, 1, 2] %e A369492 [ 9] 32 | 100000 | (((((()))))) | [6] %e A369492 [10] 34 | 100010 | (((())))(()) | [4, 2] %e A369492 [11] 36 | 100100 | ((()))((())) | [3, 3] %e A369492 [12] 38 | 100110 | ((()))()(()) | [3, 1, 2] %e A369492 [13] 42 | 101010 | (())(())(()) | [2, 2, 2] %e A369492 [14] 46 | 101110 | (())()()(()) | [2, 1, 1, 2] %e A369492 Sequence seen as table: %e A369492 [0] 1; %e A369492 [1] 0; %e A369492 [2] 2; %e A369492 [3] 4; %e A369492 [4] 8, 10; %e A369492 [5] 16, 18, 22; %e A369492 [6] 32, 34, 36, 38, 42, 46; %e A369492 [7] 64, 66, 68, 70, 74, 76, 78, 86, 90, 94; %e A369492 ... %o A369492 (SageMath) # See the notebook in the links section, that includes a time and space efficient algorithm to generate the compositions. Alternatively, using SageMath's generator: %o A369492 def pr(bw, w, dw, c): %o A369492 print(f"{bw:3d} | {str(w).ljust(7)} | {str(dw).ljust(14)} | {c}") %o A369492 def Trow(n): %o A369492 row, count = [], 0 %o A369492 for c in reversed(Compositions(n)): %o A369492 if c == []: %o A369492 count = 1 %o A369492 pr(1, 1, "()", "[()]") %o A369492 elif c == [1]: %o A369492 pr(0, 0, ".", "[]") %o A369492 elif c[-1] != 1: %o A369492 if all(part <= c[0] for part in c): %o A369492 w = Words([0, 1])(c.to_code()) %o A369492 dw = DyckWord(sum([[1]*a + [0]*a for a in c], [])) %o A369492 bw = int(str(w), 2) %o A369492 row.append(bw) %o A369492 count += 1 %o A369492 pr(bw, w, dw, c) %o A369492 # print(f"For n = {n} there are {count} composition of type A369492.") %o A369492 return row %o A369492 for n in range(0, 7): Trow(n) %Y A369492 Subsequences: A000079, A052548\{3,6}, A369491. %Y A369492 Cf. A066099, A002865, A368279, A368579. %K A369492 nonn,tabl %O A369492 0,3 %A A369492 _Peter Luschny_, Jan 25 2024