Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I M5107 #20 Oct 16 2017 01:57:47
%S 1,20,1301,202840,61889101,32676403052,27418828825961,
%T 34361404413755056,61335081309931829401,150221740688275657957940,
%U 489799709605132718770274141,2073641570051429601078643837960,11163099186064084100687107863253381
%N 3 up, 3 down, 3 up, ... permutations of length 3n+1.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D P. R. Stein, personal communication.
%H Alois P. Heinz, <a href="/A005982/b005982.txt">Table of n, a(n) for n = 1..100</a>
%H P. R. Stein & N. J. A. Sloane, <a href="/A005981/a005981.pdf">Correspondence, 1975</a>
%p b:= proc(u, o, t) option remember; `if`(u+o=0, 1, add(`if`(t=3,
%p b(o-j, u+j-1, 1), b(u+j-1, o-j, t+1)), j=1..o))
%p end:
%p a:= n-> b(0, 3*n+1, 0):
%p seq(a(n), n=1..20); # _Alois P. Heinz_, Oct 06 2013
%t b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Sum[If[t == 3, b[o-j, u+j-1, 1], b[u+j-1, o-j, t+1]], {j, 1, o}]] ; a[n_] := b[0, 3*n+1, 0]; Table[a[n], {n, 1, 20}] (* _Jean-François Alcover_, Nov 25 2014, after _Alois P. Heinz_ *)
%Y Cf. A229884.
%K nonn
%O 1,2
%A _N. J. A. Sloane_.
%E Typo in name fixed by _Alois P. Heinz_, Oct 06 2013