The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A250260 The number of 5-alternating permutations of [n]. 3
1, 1, 1, 2, 3, 4, 5, 29, 133, 412, 1041, 2300, 22991, 170832, 822198, 3114489, 10006375, 141705439, 1457872978, 9522474417, 48094772656, 202808749375, 3716808948931, 48860589990687, 403131250565618, 2545098156762649, 13287626090593750 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
A sequence a(1), a(2),... is called k-alternating if a(i) > a(i+1) iff i=1 (mod k).
LINKS
R. P. Stanley, A survey of alternating permutations, arXiv:0912.4240, page 17.
MAPLE
# dowupP defined in A250259.
A250260 :=proc(n)
downupP(n, 4) ;
end proc:
seq(A250260(n), n=0..20) ;
# second Maple program:
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t=1, add(b(u-j, o+j-1, irem(t+1, 5)), j=1..u),
add(b(u+j-1, o-j, irem(t+1, 5)), j=1..o)))
end:
a:= n-> b(0, n, 0):
seq(a(n), n=0..35); # Alois P. Heinz, Nov 15 2014
MATHEMATICA
b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, If[t == 1, Sum[b[u-j, o+j-1, Mod[t+1, 5]], {j, 1, u}], Sum[b[u+j-1, o-j, Mod[t+1, 5]], {j, 1, o}]]]; a[n_] := b[0, n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 24 2015, after Alois P. Heinz *)
CROSSREFS
Cf. A065619 (2-alternating), A249402 (3-alternating), A250259 (4-alternating).
Column k=5 of A250261.
Sequence in context: A037399 A220891 A220890 * A345306 A086130 A024636
KEYWORD
nonn
AUTHOR
R. J. Mathar, Nov 15 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 00:16 EDT 2024. Contains 372549 sequences. (Running on oeis4.)