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_dg := 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; for uidx to nops(termvars) do u := op(uidx, termvars); l1 := op(1, u); # edges on different cycles of different sizes for vidx from uidx+1 to nops(termvars) do v := op(vidx, termvars); l2 := op(1, v); res := res * a[lcm(l1, l2)] ^(2*(l1*l2/lcm(l1, l2))* degree(term, u)*degree(term, v)); od; # edges on different cycles of the same size # edges on identical cycles of some size inst1 := degree(term, u); # a[l1]^(inst1*(inst1-1)*l1*l1/l1) # a[l1]^(inst1*l1*(l1-1)/l1); res := res * a[l1]^(inst1*(inst1-1)*l1 + (l1-1)*inst1); od; all := all + lcoeff(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; GDG := proc(n) option remember; if n=0 then return 1 fi; expand(pet_varinto_cind(1+u, pet_cycleind_edg_dg(n))); end; CDG := proc(n) option remember; local res, k, p; if n=0 then return 0 fi; if n=1 then return 1 fi; res := GDG(n) - 1/n*add(GDG(n-k) *add(p*subs(u=u^(k/p), CDG(p)), p in divisors(k)), k=1..n-1) - 1/n*add(p*subs(u=u^(n/p), CDG(p)), p in divisors(n) minus {n}); expand(res); end; TRIANG_GDG := proc(m) local n, k; seq(seq(coeff(GDG(n), u, k), k=0..n*(n-1)), n=1..m); end; TRIANG_CDG := proc(m) local n, k; seq(seq(coeff(CDG(n), u, k), k=n-1..n*(n-1)), n=1..m); end; A283752 := TRIANG_GDG; A283753 := TRIANG_CDG;