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 A369584 #21 Apr 13 2025 07:11:18 %S A369584 0,0,0,0,0,1,2,6,13,30,65,140,296,622,1294,2679,5518,11323,23160, %T A369584 47250,96184,195438,396490,803292,1625591,3286340,6637913,13397224, %U A369584 27020974,54465702,109725932,220944768,444700208,894701728,1799419458,3617792587,7271505058 %N A369584 a(n) = 2^(n - 3) - A368279(n) for n >= 5, otherwise 0. Number of compositions of n whose first and last part is not equal to 1 and whose first part is not the largest part. %C A369584 We consider a tripartition of the compositions of an integer n >= 1, which we sort in lexicographic order. For this purpose, we define three predicates for a composition C. %C A369584 (1) The first part of C is the largest part of C. %C A369584 (2) The first part of C is 1. %C A369584 (3) The last part of C is 1. %C A369584 We thus define three classes of compositions: %C A369584 X(n): compositions for which (1) and not (3) applies; %C A369584 Y(n): compositions for which (2) or (3) applies; %C A369584 Z(n): compositions for which not (1) and not (2) and not (3) applies. %C A369584 X(n), Y(n), and Z(n) are disjoint classes whose union comprises all compositions of n; they thus form a disjoint tripartition of the compositions of n. The number of these compositions are given by: %C A369584 card(Z(n)) = a(n); card(X(n)) = A368279(n); card(Y(n)) = A122391(n). %F A369584 a(n) = [x^n] (1 + (x - 1)*(1 + x^2/(2*x - 1) + Sum_{k>=1} x^k/(1 - x*(1 - x^k)/(1 - x)))). %F A369584 card(X(n)) + card(Y(n)) + card(Z(n)) = A011782(n) = 2^(n - 1) for n > 0. %e A369584 The compositions of class Z(n) for n = 5..7 are: %e A369584 5: [2, 3]; %e A369584 6: [2, 1, 3], [2, 4]; %e A369584 7: [2, 1, 1, 3], [2, 1, 4], [2, 2, 3], [2, 3, 2], [2, 5], [3, 4]. %e A369584 The cardinalities of some tripartitions, |X(n)| + |Y(n)| + |Z(n)| = 2^(n - 1): %e A369584 5: 12 + 3 + 1 = 16; %e A369584 6: 24 + 6 + 2 = 32; %e A369584 7: 48 + 10 + 6 = 64; %e A369584 8: 96 + 19 + 13 = 128; %e A369584 9: 192 + 34 + 30 = 256; %e A369584 10: 384 + 63 + 65 = 512. %p A369584 gf := 1 + (x - 1)*(1 + x^2 / (2*x - 1) + sum(x^n / (1 - x*(1 - x^n)/(1 - x)), %p A369584 n = 1..42)): ser := series(gf, x, 40): seq(coeff(ser, x, n), n = 0..36); %o A369584 (SageMath) %o A369584 def A369584(n): %o A369584 if n < 5: return 0 %o A369584 return 2^(n - 3) - A368279(n) %o A369584 print([A369584(n) for n in range(37)]) %Y A369584 Cf. A011782, A122391, A368279. %K A369584 nonn %O A369584 0,7 %A A369584 _Peter Luschny_, Jan 29 2024