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.
%I A005982 M5107 #24 Jul 08 2025 16:40:29 %S A005982 1,20,1301,202840,61889101,32676403052,27418828825961, %T A005982 34361404413755056,61335081309931829401,150221740688275657957940, %U A005982 489799709605132718770274141,2073641570051429601078643837960,11163099186064084100687107863253381 %N A005982 3 up, 3 down, 3 up, ... permutations of length 3n+1. %D A005982 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A005982 P. R. Stein, personal communication. %H A005982 Alois P. Heinz, <a href="/A005982/b005982.txt">Table of n, a(n) for n = 1..100</a> %H A005982 P. R. Stein & N. J. A. Sloane, <a href="/A005981/a005981.pdf">Correspondence, 1975</a> %p A005982 b:= proc(u, o, t) option remember; `if`(u+o=0, 1, add(`if`(t=3, %p A005982 b(o-j, u+j-1, 1), b(u+j-1, o-j, t+1)), j=1..o)) %p A005982 end: %p A005982 a:= n-> b(0, 3*n+1, 0): %p A005982 seq(a(n), n=1..20); # _Alois P. Heinz_, Oct 06 2013 %t A005982 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 A005982 Cf. A229884. %K A005982 nonn %O A005982 1,2 %A A005982 _N. J. A. Sloane_ %E A005982 Typo in name fixed by _Alois P. Heinz_, Oct 06 2013