cp's OEIS Frontend

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.

A129838 Number of up/down (or down/up) compositions of n into distinct parts.

This page as a plain text file.
%I A129838 #27 Jan 18 2022 05:55:14
%S A129838 1,1,1,2,2,3,5,6,8,11,18,21,30,38,52,78,97,128,170,222,285,421,510,
%T A129838 683,872,1148,1440,1893,2576,3209,4151,5313,6784,8615,10969,13755,
%U A129838 18573,22713,29173,36536,46705,57899,73696,91076,114777,148531,182813,228938,287042
%N A129838 Number of up/down (or down/up) compositions of n into distinct parts.
%C A129838 Original name was: Number of alternating compositions of n into distinct parts.
%C A129838 A composition is up/down if it is alternately strictly increasing and strictly decreasing, starting with an increase. - _Gus Wiseman_, Jan 15 2022
%H A129838 Alois P. Heinz, <a href="/A129838/b129838.txt">Table of n, a(n) for n = 0..10000</a>
%F A129838 G.f.: Sum_{k>=0} A000111(k)*x^(k*(k+1)/2)/Product_{i=1..k} (1-x^i). - _Vladeta Jovovic_, May 24 2007
%F A129838 a(n) = Sum_{k=0..A003056(n)} A000111(k) * A008289(n,k). - _Alois P. Heinz_, Dec 22 2021
%F A129838 a(n) = (A349054(n) + 1)/2. - _Gus Wiseman_, Jan 15 2022
%e A129838 From _Gus Wiseman_, Jan 15 2022: (Start)
%e A129838 The a(1) = 1 through a(8) = 8 up/down strict compositions (non-strict A025048):
%e A129838   (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
%e A129838             (1,2)  (1,3)  (1,4)  (1,5)    (1,6)    (1,7)
%e A129838                           (2,3)  (2,4)    (2,5)    (2,6)
%e A129838                                  (1,3,2)  (3,4)    (3,5)
%e A129838                                  (2,3,1)  (1,4,2)  (1,4,3)
%e A129838                                           (2,4,1)  (1,5,2)
%e A129838                                                    (2,5,1)
%e A129838                                                    (3,4,1)
%e A129838 The a(1) = 1 through a(8) = 8 down/up strict compositions (non-strict A025049):
%e A129838   (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
%e A129838             (2,1)  (3,1)  (3,2)  (4,2)    (4,3)    (5,3)
%e A129838                           (4,1)  (5,1)    (5,2)    (6,2)
%e A129838                                  (2,1,3)  (6,1)    (7,1)
%e A129838                                  (3,1,2)  (2,1,4)  (2,1,5)
%e A129838                                           (4,1,2)  (3,1,4)
%e A129838                                                    (4,1,3)
%e A129838                                                    (5,1,2)
%e A129838 (End)
%p A129838 g:= proc(u, o) option remember;
%p A129838       `if`(u+o=0, 1, add(g(o-1+j, u-j), j=1..u))
%p A129838     end:
%p A129838 b:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
%p A129838       `if`(k=0, `if`(n=0, 1, 0), b(n-k, k)+b(n-k, k-1)))
%p A129838     end:
%p A129838 a:= n-> add(b(n, k)*g(k, 0), k=0..floor((sqrt(8*n+1)-1)/2)):
%p A129838 seq(a(n), n=0..60);  # _Alois P. Heinz_, Dec 22 2021
%t A129838 whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<y[[m+1]],y[[m]]>y[[m+1]]],{m,1,Length[y]-1}];
%t A129838 Table[Length[Select[Join@@Permutations/@ Select[IntegerPartitions[n],UnsameQ@@#&],whkQ]],{n,0,15}] (* _Gus Wiseman_, Jan 15 2022 *)
%Y A129838 The case of permutations is A000111.
%Y A129838 This is the up/down case of A032020.
%Y A129838 This is the strict case of A129852/A129853, strong A025048/A025049.
%Y A129838 The undirected version is A349054.
%Y A129838 A001250 = alternating permutations, complement A348615.
%Y A129838 A003242 = Carlitz compositions, complement A261983.
%Y A129838 A011782 = compositions, unordered A000041.
%Y A129838 A025047 = alternating compositions, complement A345192.
%Y A129838 A349052 = weakly alternating compositions, complement A349053.
%Y A129838 Cf. A003056, A008289, A008965, A015723, A072706, A128761, A218074, A345165, A345170, A345195, A349800.
%K A129838 easy,nonn
%O A129838 0,4
%A A129838 _Vladeta Jovovic_, May 21 2007
%E A129838 a(0)=1 prepended by _Alois P. Heinz_, Dec 22 2021
%E A129838 Name changed from "alternating" to "up/down" by _Gus Wiseman_, Jan 15 2022