OFFSET
0,4
COMMENTS
Original name was: Ascending wiggly sums: number of sums adding to n in which terms alternately increase and decrease.
A composition is up/down if it is alternately strictly increasing and strictly decreasing, starting with an increase. For example, the partition (3,2,2,2,1) has no up/down permutations, even though it does have the anti-run permutation (2,3,2,1,2). - Gus Wiseman, Jan 15 2022
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Wikipedia, Alternating permutation
FORMULA
a(n) ~ c * d^n, where d = 1.571630806607064114100138865739690782401305155950789062725011227781640624..., c = 0.4408955566119650057730070154620695491718230084159159991449729825619... . - Vaclav Kotesovec, Sep 12 2014
EXAMPLE
From Gus Wiseman, Jan 15 2022: (Start)
The a(1) = 1 through a(7) = 11 up/down compositions:
(1) (2) (3) (4) (5) (6) (7)
(1,2) (1,3) (1,4) (1,5) (1,6)
(1,2,1) (2,3) (2,4) (2,5)
(1,3,1) (1,3,2) (3,4)
(1,4,1) (1,4,2)
(2,3,1) (1,5,1)
(1,2,1,2) (2,3,2)
(2,4,1)
(1,2,1,3)
(1,3,1,2)
(1,2,1,2,1)
(End)
MATHEMATICA
updoQ[y_]:=And@@Table[If[EvenQ[m], y[[m]]>y[[m+1]], y[[m]]<y[[m+1]]], {m, 1, Length[y]-1}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], updoQ]], {n, 0, 15}] (* Gus Wiseman, Jan 15 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name and offset changed by Gus Wiseman, Jan 15 2022
STATUS
approved