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.

A250260 The number of 5-alternating permutations of [n].

This page as a plain text file.
%I A250260 #16 Jun 24 2015 06:40:04
%S A250260 1,1,1,2,3,4,5,29,133,412,1041,2300,22991,170832,822198,3114489,
%T A250260 10006375,141705439,1457872978,9522474417,48094772656,202808749375,
%U A250260 3716808948931,48860589990687,403131250565618,2545098156762649,13287626090593750
%N A250260 The number of 5-alternating permutations of [n].
%C A250260 A sequence a(1), a(2),... is called k-alternating if a(i) > a(i+1) iff i=1 (mod k).
%H A250260 Alois P. Heinz, <a href="/A250260/b250260.txt">Table of n, a(n) for n = 0..500</a>
%H A250260 R. P. Stanley, <a href="http://arxiv.org/abs/0912.4240">A survey of alternating permutations</a>, arXiv:0912.4240, page 17.
%p A250260 # dowupP defined in A250259.
%p A250260 A250260 :=proc(n)
%p A250260     downupP(n,4) ;
%p A250260 end proc:
%p A250260 seq(A250260(n),n=0..20) ;
%p A250260 # second Maple program:
%p A250260 b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
%p A250260      `if`(t=1, add(b(u-j, o+j-1, irem(t+1, 5)), j=1..u),
%p A250260                add(b(u+j-1, o-j, irem(t+1, 5)), j=1..o)))
%p A250260     end:
%p A250260 a:= n-> b(0, n, 0):
%p A250260 seq(a(n), n=0..35);  # _Alois P. Heinz_, Nov 15 2014
%t A250260 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_ *)
%Y A250260 Cf. A065619 (2-alternating), A249402 (3-alternating), A250259 (4-alternating).
%Y A250260 Column k=5 of A250261.
%K A250260 nonn
%O A250260 0,4
%A A250260 _R. J. Mathar_, Nov 15 2014