OFFSET
0,4
LINKS
Sean A. Irvine, Java program (github)
MAPLE
map(lmax, Bf2DfBinTreePermutationCycleLengths(some_value)); (e.g. 10)
bf2df := s -> (btbf2df(binrev(s), 0, 1)/2); # btbf2df and binrev given in A038776
Bf2DfBinTreePermutationCycleLengths := proc(upto_n) local u, n, a, r, b; a := []; for n from 0 to upto_n do b := []; u := (binomial(2*n, n)/(n+1)); for r from 0 to u-1 do b := [op(b), 1+CatalanRank(n, bf2df(CatalanUnrank(n, r)))]; od; a := [op(a), CycleLengths1(b)]; od; RETURN(a); end;
CycleLengths1 := b -> [[(nops(b)-convert(map(nops, convert(b, 'disjcyc')), `+`)), `*`, 1], op(map(nops, convert(b, 'disjcyc')))];
last_term := proc(l) local n: n := nops(l); if(0 = n) then ([]) else (op(n, l)): fi: end:
lmax := proc(a) local e, z; z := 0; for e in a do if whattype(e) = list then e := last_term(e); fi; if e > z then z := e; fi; od; RETURN(z); end;
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Antti Karttunen, Sep 07 2000
EXTENSIONS
a(11)-a(14) from Sean A. Irvine, Jun 13 2022
STATUS
approved