%% Created by Maple 9.00, Mac OS X
%% Source Worksheet: gf-test-constituents.latte.mla.mw - /Users/zaslav/Tarticles/SLS/Maple/
%% Generated: Wed Mar 10 23:08:06 EST 2010
\documentclass{article}
\usepackage{maple2e}
\def\emptyline{\vspace{12pt}}
\DefineParaStyle{maplegroup}
\DefineParaStyle{Author}
\DefineParaStyle{subtitle}
\DefineParaStyle{Bullet Item}
\DefineParaStyle{Dash Item}
\DefineParaStyle{Diagnostic}
\DefineParaStyle{Error}
\DefineParaStyle{Heading 1}
\DefineParaStyle{Heading 2}
\DefineParaStyle{Heading 3}
\DefineParaStyle{Heading 4}
\DefineParaStyle{Normal}
\DefineParaStyle{Text Output}
\DefineParaStyle{Title}
\DefineParaStyle{Warning}
\DefineCharStyle{2D Math}
\DefineCharStyle{Help Heading}
\DefineCharStyle{Maple Input}
\DefineCharStyle{FixedWidth}
\DefineCharStyle{endFixedWidth}
\begin{document}
\pagestyle{empty}
Notation:L, S:  magilatin, semimagic squares (all positive values).ml:  magilatin, except in g.f.'s.l, s:   normalized squares (symmetry types).R:   reduced squares (least element is 0).r:   reduced normalized squares (reduced symmetry types).n:  semimagic r.gf:  generating function in some form.gfsum:  generating function as a sum of simple terms.c:   Cubic (fixed strict upper bound; weak upper bound for reduced).a:   Affine (fixed magic sum).p  =  period,pno7  =  truncated period (in affine),
p7 = period of the H term in the g.f.'s, with the denominator factor (1-x\symbol{94}d7).d = degree (and dimension, in the general and no-H cases),  
d7 = degree in the H term.RtoLfactor = the rational function that multiplies Rgf to Lgf and rgf to lgf.This is for : set up main constants.\begin{mapleinput}
\mapleinline{active}{1d}{d:=4; d7:=1; 
p:=840; pno7:=120; p7:=21;
RtoLfactor:=x\symbol{94}3/(1-x\symbol{94}3);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{d := 4}{%
\[
d\, := \,4
\]
}
\mapleinline{inert}{2d}{d7 := 1}{%
\[
{\it d7}\, := \,1
\]
}
\mapleinline{inert}{2d}{p := 840}{%
\[
p\, := \,840
\]
}
\mapleinline{inert}{2d}{pno7 := 120}{%
\[
{\it pno7}\, := \,120
\]
}
\mapleinline{inert}{2d}{p7 := 21}{%
\[
{\it p7}\, := \,21
\]
}
\mapleinline{inert}{2d}{RtoLfactor := x^3/(1-x^3)}{%
\[
{\it RtoLfactor}\, := \,{\frac {{x}^{3}}{1-{x}^{3}}}
\]
}

\end{maplelatex}
enddegree:  The number of terms of the L and l sequences to check in testing the constituents.  \begin{mapleinput}
\mapleinline{active}{1d}{enddegree:=2000;}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{enddegree := 2000}{%
\[
{\it enddegree}\, := \,2000
\]
}

\end{maplelatex}
We start by recomputing rs from the semimagic count.  From the Latte results we get the closed Ehrhart g.f. of each flat, which depends on whether we're doing cubic or affine.This is for : set up simplex data.\begin{mapleinput}
\mapleinline{active}{1d}{simplexname[1]:="OABC": ehrgf[1]:= 1/((1-x)*(1-x\symbol{94}2)\symbol{94}3) : dimen[1]:=3:
simplexname[2]:="OEE2": ehrgf[2]:= 1/((1-x)*(1-x\symbol{94}4)\symbol{94}2) : dimen[2]:=2:
simplexname[3]:="OAE2": ehrgf[3]:= 1/((1-x)*(1-x\symbol{94}2)*(1-x\symbol{94}4)) : dimen[3]:=2:
simplexname[4]:="ADE2": ehrgf[4]:= 1/((1-x\symbol{94}2)*(1-x\symbol{94}3)*(1-x\symbol{94}4)) : dimen[4]:=2:
simplexname[5]:="DE1E2": ehrgf[5]:= 1/((1-x\symbol{94}3)*(1-x\symbol{94}4)\symbol{94}2) : dimen[5]:=2:
simplexname[6]:="OCE": ehrgf[6]:= 1/((1-x)*(1-x\symbol{94}2)*(1-x\symbol{94}4)) : dimen[6]:=2:
simplexname[7]:="BDE1": ehrgf[7]:= 1/((1-x\symbol{94}2)*(1-x\symbol{94}3)*(1-x\symbol{94}4)) : dimen[7]:=2:
simplexname[8]:="ABD": ehrgf[8]:= 1/((1-x\symbol{94}2)\symbol{94}2*(1-x\symbol{94}3)) : dimen[8]:=2:
simplexname[9]:="FG1": ehrgf[9]:= 1/((1-x\symbol{94}5)*(1-x\symbol{94}8)) : dimen[9]:=1:
simplexname[10]:="EF": ehrgf[10]:= 1/((1-x\symbol{94}4)*(1-x\symbol{94}5)) : dimen[10]:=1:
simplexname[11]:="OG": ehrgf[11]:= 1/((1-x)*(1-x\symbol{94}6)) : dimen[11]:=1:
simplexname[12]:="FG": ehrgf[12]:= 1/((1-x\symbol{94}5)*(1-x\symbol{94}6)) : dimen[12]:=1:
simplexname[13]:="AF": ehrgf[13]:= 1/((1-x\symbol{94}2)*(1-x\symbol{94}5)) : dimen[13]:=1:
simplexname[14]:="DG": ehrgf[14]:= 1/((1-x\symbol{94}3)*(1-x\symbol{94}6)) : dimen[14]:=1:
simplexname[15]:="DG2": ehrgf[15]:= 1/((1-x\symbol{94}3)*(1-x\symbol{94}8)) : dimen[15]:=1:
simplexname[16]:="DE": ehrgf[16]:= 1/((1-x\symbol{94}3)*(1-x\symbol{94}4)) : dimen[16]:=1:
simplexname[17]:="H": ehrgf[17] := 1/(1-x\symbol{94}7) : dimen[17]:=0:
# for n from 1 to 17 do print(simplexname[n], dimen[n], ehrgf[n]); od;}{}
\end{mapleinput}The closed E.g.f. is converted to the open E.g.f.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to 17 do 
  mu[n]:=(-1)\symbol{94}(dimen[1]-dimen[n]):
od:
mu[14]:=2*mu[14]:
for n from 1 to 17 do  
  openehrgf[n]:=simplify(-(-1)\symbol{94}dimen[n]*subs(x=1/x,ehrgf[n])):
od:}{}
\end{mapleinput}Set up basic g.f.'s.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to 17 do 
  rsgfterm[n]:=openehrgf[n]: 
od:
rsgf:=sum(mu[nn]*rsgfterm[nn],nn=1..17);
sgf:=RtoLfactor*rsgf:
rsno7gf:=sum(mu[nn]*rsgfterm[nn],nn=1..16);
sno7gf:=RtoLfactor*rsno7gf:
r7gf:=rsgfterm[17];
openehrgf[17];
mu[17];
l7gf:=RtoLfactor*r7gf:}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{rsgf := x^7/((x-1)*(x^2-1)^3)+x^9/((x-1)*(x^4-1)^2)+2*x^7/((x-1)*(x^2-1)*(x^4-1))+2*x^9/((x^2-1)*(x^3-1)*(x^4-1))+x^11/((x^3-1)*(x^4-1)^2)+x^7/((x^2-1)^2*(x^3-1))+x^13/((x^5-1)*(x^8-1))+x^9/((x^4-1)*(x^5-1))+x^7/((x-1)*(x^6-1))+x^11/((x^5-1)*(x^6-1))+x^7/((x^2-1)*(x^5-1))+2*x^9/((x^3-1)*(x^6-1))+x^11/((x^3-1)*(x^8-1))+x^7/((x^3-1)*(x^4-1))+x^7/(x^7-1)}{%
${\it rsgf}\, := \,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{3}}}+{\frac {{x}^{9}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+2\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}\\
\mbox{}+2\,{\frac {{x}^{9}}{ \left( {x}^{2}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}+{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right) ^{2} \left( {x}^{3}-1 \right) }}\\
\mbox{}+{\frac {{x}^{13}}{ \left( {x}^{5}-1 \right)  \left( {x}^{8}-1 \right) }}+{\frac {{x}^{9}}{ \left( {x}^{4}-1 \right)  \left( {x}^{5}-1 \right) }}+{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{6}-1 \right) }}+{\frac {{x}^{11}}{ \left( {x}^{5}-1 \right)  \left( {x}^{6}-1 \right) }}\\
\mbox{}+{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right)  \left( {x}^{5}-1 \right) }}+2\,{\frac {{x}^{9}}{ \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}+{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{8}-1 \right) }}+{\frac {{x}^{7}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}\\
\mbox{}+{\frac {{x}^{7}}{{x}^{7}-1}}$}
\mapleinline{inert}{2d}{rsno7gf := x^7/((x-1)*(x^2-1)^3)+x^9/((x-1)*(x^4-1)^2)+2*x^7/((x-1)*(x^2-1)*(x^4-1))+2*x^9/((x^2-1)*(x^3-1)*(x^4-1))+x^11/((x^3-1)*(x^4-1)^2)+x^7/((x^2-1)^2*(x^3-1))+x^13/((x^5-1)*(x^8-1))+x^9/((x^4-1)*(x^5-1))+x^7/((x-1)*(x^6-1))+x^11/((x^5-1)*(x^6-1))+x^7/((x^2-1)*(x^5-1))+2*x^9/((x^3-1)*(x^6-1))+x^11/((x^3-1)*(x^8-1))+x^7/((x^3-1)*(x^4-1))}{%
${\it rsno7gf}\, := \,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{3}}}+{\frac {{x}^{9}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+2\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}\\
\mbox{}+2\,{\frac {{x}^{9}}{ \left( {x}^{2}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}+{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right) ^{2} \left( {x}^{3}-1 \right) }}\\
\mbox{}+{\frac {{x}^{13}}{ \left( {x}^{5}-1 \right)  \left( {x}^{8}-1 \right) }}+{\frac {{x}^{9}}{ \left( {x}^{4}-1 \right)  \left( {x}^{5}-1 \right) }}+{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{6}-1 \right) }}+{\frac {{x}^{11}}{ \left( {x}^{5}-1 \right)  \left( {x}^{6}-1 \right) }}\\
\mbox{}+{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right)  \left( {x}^{5}-1 \right) }}+2\,{\frac {{x}^{9}}{ \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}+{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{8}-1 \right) }}+{\frac {{x}^{7}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}$}
\mapleinline{inert}{2d}{r7gf := -x^7/(x^7-1)}{%
\[
{\it r7gf}\, := \,-{\frac {{x}^{7}}{{x}^{7}-1}}
\]
}
\mapleinline{inert}{2d}{-x^7/(x^7-1)}{%
\[
-{\frac {{x}^{7}}{{x}^{7}-1}}
\]
}
\mapleinline{inert}{2d}{-1}{%
\[
-1
\]
}

\end{maplelatex}
The additional faces and intersection polytopes involved in the magilatin computation.  They depend on whether we're cubic or affine.  These are for . \begin{mapleinput}
\mapleinline{active}{1d}{mlsimplexname[1]:="OAB": mlehrgf[1]:= 1 / ((1-x)*(1-x\symbol{94}2)\symbol{94}2) : mldimen[1]:=2:
mlsimplexname[2]:="OE": mlehrgf[2]:= 1 / ((1-x)*(1-x\symbol{94}4)) : mldimen[2]:=1:
mlsimplexname[3]:="OAC": mlehrgf[3]:= 1 / ((1-x)*(1-x\symbol{94}2)\symbol{94}2) : mldimen[3]:=2:
mlsimplexname[4]:="AD": mlehrgf[4]:= 1 / ((1-x\symbol{94}3)*(1-x\symbol{94}2)) : mldimen[4]:=1:
mlsimplexname[5]:="DE1": mlehrgf[5]:= 1 / ((1-x\symbol{94}3)*(1-x\symbol{94}4)) : mldimen[5]:=1:
mlsimplexname[6]:="OBC": mlehrgf[6]:= 1 / ((1-x)*(1-x\symbol{94}2)\symbol{94}2) : mldimen[6]:=2:
mlsimplexname[7]:="OE2": mlehrgf[7]:= 1 / ((1-x)*(1-x\symbol{94}4)) : mldimen[7]:=1:
mlsimplexname[8]:="BD": mlehrgf[8]:= 1 / ((1-x\symbol{94}2)*(1-x\symbol{94}3)) : mldimen[8]:=1:
mlsimplexname[9]:="DE2": mlehrgf[9]:= 1 / ((1-x\symbol{94}3)*(1-x\symbol{94}4)) : mldimen[9]:=1:
mlsimplexname[10]:="F": mlehrgf[10]:= 1/(1-x\symbol{94}5) : mldimen[10]:=0:
mlsimplexname[11]:="OB": mlehrgf[11]:= 1/((1-x)*(1-x\symbol{94}2)) : mldimen[11]:=1:
# for n from 1 to 11 do print(mlsimplexname[n], mldimen[n], mlehrgf[n]); od;}{}
\end{mapleinput}Now a general computation.  First, open Ehrhart g.f.'s.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to 11 do  
  openmlehrgf[n]:=simplify(-(-1)\symbol{94}mldimen[n]*subs(x=1/x,mlehrgf[n]));
od:}{}
\end{mapleinput}(-1)\symbol{94}3 n_OAB(1/x) equals mlehrgf[1]+mlehrgf[2], and hence n_OAB(x) is, \begin{mapleinput}
\mapleinline{active}{1d}{mlnnew[1] := openmlehrgf[1]-openmlehrgf[2]:}{}
\end{mapleinput}(-1)\symbol{94}3 n_OAC(1/x) equals mlehrgf[3]+mlehrgf[4]+mlehrgf[5].  Hence n_OAC(x) equals\begin{mapleinput}
\mapleinline{active}{1d}{mlnnew[2] := openmlehrgf[3]-openmlehrgf[4]-openmlehrgf[5]:}{}
\end{mapleinput}(-1)\symbol{94}3 n_OBC(1/x) equals mlehrgf[6]+mlehrgf[7]+mlehrgf[8]+mlehrgf[9]+mlehrgf[10].  So n_OBC(x) equals \begin{mapleinput}
\mapleinline{active}{1d}{mlnnew[3] := openmlehrgf[6]-openmlehrgf[7]-openmlehrgf[8]-openmlehrgf[9]+openmlehrgf[10]:}{}
\end{mapleinput}Finally, OB gives mlehrgf[11], so that n_OB(x) is\begin{mapleinput}
\mapleinline{active}{1d}{mlnnew[4] := openmlehrgf[11]:}{}
\end{mapleinput}To compute R, we need rs=n from semimagic, which equals rgf:\begin{mapleinput}
\mapleinline{active}{1d}{Rgfsum:=72*rsgf+36*(mlnnew[1]+mlnnew[2]+mlnnew[3])+12*mlnnew[4];
Rgf:=simplify(Rgfsum):
Rno7gfsum:=72*rsno7gf+36*(mlnnew[1]+mlnnew[2]+mlnnew[3])+12*mlnnew[4];
Rno7gf:=simplify(Rno7gfsum):
R7gf:=72*r7gf:}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Rgfsum := 144*x^7/((x-1)*(x^2-1)*(x^4-1))+144*x^9/((x^2-1)*(x^3-1)*(x^4-1))+72*x^7/((x-1)*(x^2-1)^3)+72*x^9/((x-1)*(x^4-1)^2)+72*x^11/((x^3-1)*(x^4-1)^2)+72*x^7/((x^2-1)^2*(x^3-1))+72*x^13/((x^5-1)*(x^8-1))+72*x^9/((x^4-1)*(x^5-1))+72*x^7/((x-1)*(x^6-1))+72*x^11/((x^5-1)*(x^6-1))+72*x^7/((x^2-1)*(x^5-1))+144*x^9/((x^3-1)*(x^6-1))+72*x^11/((x^3-1)*(x^8-1))+72*x^7/(x^7-1)-108*x^5/((x-1)*(x^2-1)^2)-72*x^5/((x-1)*(x^4-1))-36*x^5/(x^5-1)-72*x^5/((x^3-1)*(x^2-1))+12*x^3/((x-1)*(x^2-1))}{%
${\it Rgfsum}\, := \,144\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}+144\,{\frac {{x}^{9}}{ \left( {x}^{2}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{3}}}+72\,{\frac {{x}^{9}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+72\,{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right) ^{2} \left( {x}^{3}-1 \right) }}+72\,{\frac {{x}^{13}}{ \left( {x}^{5}-1 \right)  \left( {x}^{8}-1 \right) }}+72\,{\frac {{x}^{9}}{ \left( {x}^{4}-1 \right)  \left( {x}^{5}-1 \right) }}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{11}}{ \left( {x}^{5}-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right)  \left( {x}^{5}-1 \right) }}\\
\mbox{}+144\,{\frac {{x}^{9}}{ \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{8}-1 \right) }}+72\,{\frac {{x}^{7}}{{x}^{7}-1}}-108\,{\frac {{x}^{5}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{2}}}\\
\mbox{}-72\,{\frac {{x}^{5}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) }}-36\,{\frac {{x}^{5}}{{x}^{5}-1}}-72\,{\frac {{x}^{5}}{ \left( {x}^{3}-1 \right)  \left( {x}^{2}-1 \right) }}+12\,{\frac {{x}^{3}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) }}$}
\mapleinline{inert}{2d}{Rno7gfsum := 144*x^7/((x-1)*(x^2-1)*(x^4-1))+144*x^9/((x^2-1)*(x^3-1)*(x^4-1))+72*x^7/((x-1)*(x^2-1)^3)+72*x^9/((x-1)*(x^4-1)^2)+72*x^11/((x^3-1)*(x^4-1)^2)+72*x^7/((x^2-1)^2*(x^3-1))+72*x^13/((x^5-1)*(x^8-1))+72*x^9/((x^4-1)*(x^5-1))+72*x^7/((x-1)*(x^6-1))+72*x^11/((x^5-1)*(x^6-1))+72*x^7/((x^2-1)*(x^5-1))+144*x^9/((x^3-1)*(x^6-1))+72*x^11/((x^3-1)*(x^8-1))-108*x^5/((x-1)*(x^2-1)^2)-72*x^5/((x-1)*(x^4-1))-36*x^5/(x^5-1)-72*x^5/((x^3-1)*(x^2-1))+12*x^3/((x-1)*(x^2-1))}{%
${\it Rno7gfsum}\, := \,144\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}+144\,{\frac {{x}^{9}}{ \left( {x}^{2}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{3}}}+72\,{\frac {{x}^{9}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+72\,{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right) ^{2} \left( {x}^{3}-1 \right) }}+72\,{\frac {{x}^{13}}{ \left( {x}^{5}-1 \right)  \left( {x}^{8}-1 \right) }}+72\,{\frac {{x}^{9}}{ \left( {x}^{4}-1 \right)  \left( {x}^{5}-1 \right) }}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{11}}{ \left( {x}^{5}-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right)  \left( {x}^{5}-1 \right) }}\\
\mbox{}+144\,{\frac {{x}^{9}}{ \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{8}-1 \right) }}-108\,{\frac {{x}^{5}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{2}}}\\
\mbox{}-72\,{\frac {{x}^{5}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) }}-36\,{\frac {{x}^{5}}{{x}^{5}-1}}-72\,{\frac {{x}^{5}}{ \left( {x}^{3}-1 \right)  \left( {x}^{2}-1 \right) }}+12\,{\frac {{x}^{3}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) }}$}

\end{maplelatex}
Hence L, the g.f. of the number of magilatin squares, equals\begin{mapleinput}
\mapleinline{active}{1d}{Lgfsum:=RtoLfactor*Rgfsum:
Lgf:=simplify(Lgfsum):
Lno7gfsum:=RtoLfactor*Rno7gfsum;
Lno7gf:=simplify(Lno7gfsum):
L7gf:=72*l7gf:}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Lno7gfsum := x^3*(144*x^7/((x-1)*(x^2-1)*(x^4-1))+144*x^9/((x^2-1)*(x^3-1)*(x^4-1))+72*x^7/((x-1)*(x^2-1)^3)+72*x^9/((x-1)*(x^4-1)^2)+72*x^11/((x^3-1)*(x^4-1)^2)+72*x^7/((x^2-1)^2*(x^3-1))+72*x^13/((x^5-1)*(x^8-1))+72*x^9/((x^4-1)*(x^5-1))+72*x^7/((x-1)*(x^6-1))+72*x^11/((x^5-1)*(x^6-1))+72*x^7/((x^2-1)*(x^5-1))+144*x^9/((x^3-1)*(x^6-1))+72*x^11/((x^3-1)*(x^8-1))-108*x^5/((x-1)*(x^2-1)^2)-72*x^5/((x-1)*(x^4-1))-36*x^5/(x^5-1)-72*x^5/((x^3-1)*(x^2-1))+12*x^3/((x-1)*(x^2-1)))/(1-x^3)}{%
${\it Lno7gfsum}\, := \,{x}^{3} \left( 144\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}+144\,{\frac {{x}^{9}}{ \left( {x}^{2}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) }}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{3}}}+72\,{\frac {{x}^{9}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}+72\,{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{4}-1 \right) ^{2}}}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right) ^{2} \left( {x}^{3}-1 \right) }}+72\,{\frac {{x}^{13}}{ \left( {x}^{5}-1 \right)  \left( {x}^{8}-1 \right) }}+72\,{\frac {{x}^{9}}{ \left( {x}^{4}-1 \right)  \left( {x}^{5}-1 \right) }}\\
\mbox{}+72\,{\frac {{x}^{7}}{ \left( x-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{11}}{ \left( {x}^{5}-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{7}}{ \left( {x}^{2}-1 \right)  \left( {x}^{5}-1 \right) }}\\
\mbox{}+144\,{\frac {{x}^{9}}{ \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}+72\,{\frac {{x}^{11}}{ \left( {x}^{3}-1 \right)  \left( {x}^{8}-1 \right) }}-108\,{\frac {{x}^{5}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) ^{2}}}\\
\mbox{}-72\,{\frac {{x}^{5}}{ \left( x-1 \right)  \left( {x}^{4}-1 \right) }}-36\,{\frac {{x}^{5}}{{x}^{5}-1}}-72\,{\frac {{x}^{5}}{ \left( {x}^{3}-1 \right)  \left( {x}^{2}-1 \right) }}+12\,{\frac {{x}^{3}}{ \left( x-1 \right)  \left( {x}^{2}-1 \right) }}\\
\mbox{} \right)  \left( 1-{x}^{3} \right) ^{-1}$}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{rgfsum:=rsgf+mlnnew[1]+mlnnew[2]+mlnnew[3]+mlnnew[4]:
rgf:=simplify(rgfsum):
rno7gfsum:=rsno7gf+mlnnew[1]+mlnnew[2]+mlnnew[3]+mlnnew[4]:
rno7gf:=simplify(rno7gfsum):}{}
\end{mapleinput}The g.f. of the total number of symmetry types, l_ml ("lgf"):\begin{mapleinput}
\mapleinline{active}{1d}{lgfsum:=RtoLfactor*rgfsum:
lgf:=simplify(lgfsum): 
lno7gfsum:=RtoLfactor*rno7gfsum:
lno7gf:=simplify(lno7gfsum): }{}
\end{mapleinput}Expressing the rational function with standard denominator gives an orders-of-magnitude speedup in the series expansion.  Standard denominator (1-x\symbol{94}p)\symbol{94}{d+1}.  \begin{mapleinput}
\mapleinline{active}{1d}{pdenom:=(1-x\symbol{94}p):
standenom:=pdenom\symbol{94}(d+1):
pno7denom:=(1-x\symbol{94}pno7):
stanno7denom:=pno7denom\symbol{94}(d+1):
p7denom:=(1-x\symbol{94}p7):
stan7denom:=p7denom\symbol{94}(d7+1):}{}
\end{mapleinput}G.f. as rational function with standard denominator.\begin{mapleinput}
\mapleinline{active}{1d}{Lgfstandnum:=simplify(numer(Lgf)*simplify(standenom/denom(Lgf))):
Lgf:=Lgfstandnum/standenom:}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{Lno7gfstandnum:=simplify(numer(Lno7gf)*simplify(stanno7denom/denom(Lno7gf))):
Lno7gf:=Lno7gfstandnum/stanno7denom:}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{L7gfstandnum:=simplify(numer(L7gf)*simplify(stan7denom/denom(L7gf))):
L7gf:=L7gfstandnum/stan7denom:}{}
\end{mapleinput}G.f. as rational function with standard denominator.\begin{mapleinput}
\mapleinline{active}{1d}{Rgfstandnum:=simplify(numer(Rgf)*standenom/denom(Rgf)):
Rgf:=Rgfstandnum/standenom:}{}
\end{mapleinput}G.f. as rational function with standard denominator.\begin{mapleinput}
\mapleinline{active}{1d}{lgfstandnum:=simplify(numer(lgf)*simplify(standenom/denom(lgf))): 
lgf:=lgfstandnum/standenom:}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{lno7gfstandnum:=simplify(numer(lno7gf)*simplify(stanno7denom/denom(lno7gf))): 
lno7gf:=lno7gfstandnum/stanno7denom:}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{l7gfstandnum:=simplify(numer(l7gf)*simplify(stan7denom/denom(l7gf))): 
l7gf:=l7gfstandnum/stan7denom:}{}
\end{mapleinput}G.f. as rational function with standard denominator.\begin{mapleinput}
\mapleinline{active}{1d}{rgfstandnum:=simplify(numer(rgf)*standenom/denom(rgf)):
rgf:=rgfstandnum/standenom:}{}
\end{mapleinput}Expand the series to find the first few values of the number of squares.\begin{mapleinput}
\mapleinline{active}{1d}{Lseries:=series(Lgf,x=0,enddegree+1):}{}
\end{mapleinput}Expand the series to find the first few values of the number of reduced squares.\begin{mapleinput}
\mapleinline{active}{1d}{#Rseries:=series(Rgf,x=0,enddegree+1):}{}
\end{mapleinput}Expand the series to find the first few values of the number of symmetry types.\begin{mapleinput}
\mapleinline{active}{1d}{lseries:=series(lgf,x=0,enddegree+1):}{}
\end{mapleinput}Expand the series to find the first few values of the number of reduced symmetry types.\begin{mapleinput}
\mapleinline{active}{1d}{#rseries:=series(rgf,x=0,enddegree+1):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{Lzeroth:=expand(
sum( coeff(Lgfstandnum,x,p*j)*binomial(d+t/p-j,d) ,j=0..d+1) );
#print(subs(t=0,Lzeroth)):  }{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Lzeroth := -9192/35*t+151/4*t^2-3*t^3+1/8*t^4+948}{%
\[
{\it Lzeroth}\, := \,-{\frac {9192}{35}}\,t+{\frac {151}{4}}\,{t}^{2}-3\,{t}^{3}+1/8\,{t}^{4}+948
\]
}

\end{maplelatex}
Calculate the zeroth constituent of the .  Find its constant term.\begin{mapleinput}
\mapleinline{active}{1d}{Lno7zeroth:=expand(
sum(coeff(Lno7gfstandnum,x,pno7*j)*binomial(d+t/pno7-j,d),j=0..d+1) );
#print(subs(t=0,Lno7zeroth)):  }{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Lno7zeroth := -1296/5*t+151/4*t^2-3*t^3+1/8*t^4+876}{%
\[
{\it Lno7zeroth}\, := \,-{\frac {1296}{5}}\,t+{\frac {151}{4}}\,{t}^{2}-3\,{t}^{3}+1/8\,{t}^{4}+876
\]
}

\end{maplelatex}
Extract the constituents of the total magilatin counting function.\begin{mapleinput}
\mapleinline{active}{1d}{Lno7constituent[0]:=Lno7zeroth:
for r from 1 to pno7  do
  Lno7constituent[r]:=expand(sum( coeff(Lno7gfstandnum,x,pno7*j+r)*binomial(d+(t-r)/pno7-j,d), j=0..d)):
#  print(r):
#  print( Lno7constituent[r] ):
#  print( factor(Lno7constituent[r]) ):
od:}{}
\end{mapleinput}Calculate the zeroth constituent of the .  Find its constant term.\begin{mapleinput}
\mapleinline{active}{1d}{lno7zeroth:=expand(
sum(coeff(lno7gfstandnum,x,pno7*j)*binomial(d+t/pno7-j,d),j=0..d+1) );
#print(subs(t=0,lno7zeroth)):  }{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{lno7zeroth := -31/15*t+25/96*t^2-1/48*t^3+1/576*t^4+8}{%
${\it lno7zeroth}\, := \,-{\frac {31}{15}}\,t+{\frac {25}{96}}\,{t}^{2}-1/48\,{t}^{3}+{\frac {1}{576}}\,{t}^{4}\\
\mbox{}+8$}

\end{maplelatex}
Extract the constituents of the truncated magilatin symmetry-type counting function.\begin{mapleinput}
\mapleinline{active}{1d}{lno7constituent[0]:=lno7zeroth:
for r from 1 to pno7  do
  lno7constituent[r]:=expand(sum( coeff(lno7gfstandnum,x,pno7*j+r)*binomial(d+(t-r)/pno7-j,d), j=0..d)):
#  print(r):
#  print( lno7constituent[r] ):
#  print( factor(lno7constituent[r]) ):
od: }{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{L7gfstandnum: p7; d7; }{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{21}{%
\[
21
\]
}
\mapleinline{inert}{2d}{1}{%
\[
1
\]
}

\end{maplelatex}
Calculate the zeroth constituent of the .  Find its constant term.\begin{mapleinput}
\mapleinline{active}{1d}{L7zeroth:=expand(
sum(coeff(L7gfstandnum,x,p7*j)*binomial(d7+t/p7-j,d7),j=0..d7+1) );
#print(subs(t=0,L7zeroth)):  }{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{L7zeroth := -72+24/7*t}{%
\[
{\it L7zeroth}\, := \,-72+{\frac {24}{7}}\,t
\]
}

\end{maplelatex}
Extract the constituents of the total magilatin counting function.\begin{mapleinput}
\mapleinline{active}{1d}{L7constituent[0]:=L7zeroth:
for r from 1 to p7  do
  L7constituent[r]:=expand(sum( coeff(L7gfstandnum,x,p7*j+r)*binomial(d7+(t-r)/p7-j,d7), j=0..d7 )):
#  print(r):
#  print( L7constituent[r] ):
#  print( factor(L7constituent[r]) ):
#  print( L7constituent[r]-24/7*(t-r) ):
od:}{}
\end{mapleinput}Calculate the zeroth constituent of the .  Find its constant term.\begin{mapleinput}
\mapleinline{active}{1d}{l7zeroth:=expand(
sum(coeff(numer(l7gf),x,p7*j)*binomial(d7+t/p7-j,d7),j=0..d7+1) );
#print(subs(t=0,l7zeroth)):  }{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{l7zeroth := -1+1/21*t}{%
\[
{\it l7zeroth}\, := \,-1+1/21\,t
\]
}

\end{maplelatex}
Extract the constituents of the magilatin symmetry-type counting function.\begin{mapleinput}
\mapleinline{active}{1d}{l7constituent[0]:=l7zeroth:
for r from 1 to p7  do
  l7constituent[r]:=expand(sum( coeff(numer(l7gf),x,p7*j+r)*binomial(d7+(t-r)/p7-j,d7), j=0..d7)):
#  print(r):
#  print( l7constituent[r] ):
#  print( factor(l7constituent[r]) ):
#  print( l7constituent[r]-1/21*(t-r) ):
od: }{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
 co:=coeff(Lseries,x,n):
 rno7:=modp(n,pno7);
 qno7:=(n-r)/pno7;
 r7:=modp(n,p7);
 q7:=(n-r7)/p7;
 termno7:=eval(Lno7constituent[rno7],t=n);
 term7:=eval(L7constituent[r7],t=n);
 term:=termno7+mu[17]*term7;
 if ( co <\TEXTsymbol{>} term ) then printf("n= %d, r= %d, r7= %d;   no-H %d, H %d, seq %d, error %d \n",n,r,r7,term,term7,co, co-term) fi;
# if ( co = term ) then print(n,rno7,r7) fi;
od:
print("L constituent test complete to ",enddegree);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"L constituent test complete to ", 2000}{%
$\mbox {{\tt ``L constituent test complete to ''}},\,2000$}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
 co:=coeff(lseries,x,n):
 rno7:=modp(n,pno7);
 qno7:=(n-r)/pno7;
 r7:=modp(n,p7);
 q7:=(n-r7)/p7;
 termno7:=eval(lno7constituent[rno7],t=n);
 term7:=eval(l7constituent[r7],t=n);
 term:=termno7+mu[17]*term7;
 if ( co <\TEXTsymbol{>} term ) then printf("n= %d, r= %d, r7= %d;   no-H %d, H %d, seq %d, error %d \n",n,r,r7,term,term7,co, co-term) fi;
# if ( co = term ) then print(n,rno7,r7) fi;
od:
print("l constituent test complete to ",enddegree);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"l constituent test complete to ", 2000}{%
$\mbox {{\tt ``l constituent test complete to ''}},\,2000$}

\end{maplelatex}
\end{document}
%% End of Maple 9.00 Output