with(numtheory); pet_cycleind_symm := proc(n) option remember; local l; if n=0 then return 1; fi; expand(1/n*add(a[l]*pet_cycleind_symm(n-l), l=1..n)); end; pet_cycleind_edg_sl := proc(n) option remember; local all, term, termvars, res, l1, l2, inst1, u, v, uidx, vidx; if n=0 or n=1 then return 1; fi; all := 0: for term in pet_cycleind_symm(n) do termvars := indets(term); res := 1; # edges on different cycles of different sizes for uidx to nops(termvars) do u := op(uidx, termvars); l1 := op(1, u); for vidx from uidx+1 to nops(termvars) do v := op(vidx, termvars); l2 := op(1, v); res := res * a[lcm(l1, l2)] ^((l1*l2/lcm(l1, l2))* degree(term, u)*degree(term, v)); od; od; # edges on different cycles of the same size for u in termvars do l1 := op(1, u); inst1 := degree(term, u); # a[l1]^(1/2*inst1*(inst1-1)*l1*l1/l1) res := res * a[l1]^(1/2*inst1*(inst1-1)*l1); od; # edges on identical cycles of some size for u in termvars do l1 := op(1, u); inst1 := degree(term, u); if type(l1, odd) then # a[l1]^(1/2*l1*(l1-1)/l1); res := res * (a[l1]^(1/2*(l1-1)))^inst1; else # a[l1/2]^(l1/2/(l1/2))*a[l1]^(1/2*l1*(l1-2)/l1) res := res * (a[l1/2]*a[l1]^(1/2*(l1-2)))^inst1; fi; od; all := all + term*res; od; all; end; pet_varinto_cind := proc(poly, ind) local subs1, subs2, polyvars, indvars, v, pot, res, k; res := ind; polyvars := indets(poly); indvars := indets(ind); for v in indvars do pot := op(1, v); subs1 := [seq(polyvars[k]=polyvars[k]^pot, k=1..nops(polyvars))]; subs2 := [v=subs(subs1, poly)]; res := subs(subs2, res); od; res; end; GSL := proc(n) option remember; if n=0 then return 1 fi; if n=1 then return 1+u fi; expand(pet_varinto_cind(1+u, pet_cycleind_edg_sl(n))); end; CSL := proc(n) option remember; local res, k, p; if n=0 then return 0 fi; if n=1 then return 1+u fi; res := GSL(n) - 1/n*add(GSL(n-k) *add(p*subs(u=u^(k/p), CSL(p)), p in divisors(k)), k=1..n-1) - 1/n*add(p*subs(u=u^(n/p), CSL(p)), p in divisors(n) minus {n}); expand(res); end; TRIANG_GSL := proc(m) local n, k; seq(seq(coeff(GSL(n), u, k), k=0..n*(n+1)/2), n=1..m); end; TRIANG_CSL := proc(m) local n, k; seq(seq(coeff(CSL(n), u, k), k=n-1..n*(n+1)/2), n=1..m); end; A283754 := TRIANG_GSL; A283755 := TRIANG_CSL;