%% Created by Maple 9.00, Mac OS X
%% Source Worksheet: gf-sequences.latte.m.mw - /Users/zaslav/Tarticles/SLS/Maple/
%% Generated: Mon Mar 15 19:53:09 EDT 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}
The number of terms to evaluate in the series expansions, to find the actual numbers of squares and symmetry types, M_c(t), m_c(t), M_a(t), m_a(t).Small values, like 1000, are computed quickly.  Large values, like 10000 (cubic) or 30000 (affine) take noticeably longer.\begin{mapleinput}
\mapleinline{active}{1d}{enddegree:=100;}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{enddegree := 100}{%
\[
{\it enddegree}\, := \,100
\]
}

\end{maplelatex}
The dimension and period for cubical magic, and the standard denominator:\begin{mapleinput}
\mapleinline{active}{1d}{d:=3:
p:=12:
cdenom:=(1-x\symbol{94}p)\symbol{94}(d+1):}{}
\end{mapleinput}See Section 2.1 of "Six Little Squares". We get LattE to spit out two generating functions--one for the polytope P_c:\begin{mapleinput}
\mapleinline{active}{1d}{ehrpc:= 1 / ((1-t) * (1-t) * (1-t\symbol{94}2) * (1-t\symbol{94}4)):}{}
\end{mapleinput}... and one for h intersect P_c:\begin{mapleinput}
\mapleinline{active}{1d}{ehrhc:= 1 / ((1-t) * (1-t) * (1-t\symbol{94}6)):}{}
\end{mapleinput}LattE gives the closed generating functions, which we need to convert into their open counterparts:\begin{mapleinput}
\mapleinline{active}{1d}{openehrpc:=simplify(subs(t=1/x,ehrpc)):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{openehrhc:=simplify(-subs(t=1/x,ehrhc)):}{}
\end{mapleinput}By IOP theory, the generating function for the magic quasipolynomial is\begin{mapleinput}
\mapleinline{active}{1d}{mcgfsum:=openehrpc-openehrhc;
Mcgfsum:=8*mcgfsum;}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{mcgfsum := x^8/((x-1)^2*(x^2-1)*(x^4-1))+x^8/((x-1)^2*(x^6-1))}{%
\[
{\it mcgfsum}\, := \,{\frac {{x}^{8}}{ \left( x-1 \right) ^{2} \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}+{\frac {{x}^{8}}{ \left( x-1 \right) ^{2} \left( {x}^{6}-1 \right) }}
\]
}
\mapleinline{inert}{2d}{Mcgfsum := 8*x^8/((x-1)^2*(x^2-1)*(x^4-1))+8*x^8/((x-1)^2*(x^6-1))}{%
\[
{\it Mcgfsum}\, := \,8\,{\frac {{x}^{8}}{ \left( x-1 \right) ^{2} \left( {x}^{2}-1 \right)  \left( {x}^{4}-1 \right) }}+8\,{\frac {{x}^{8}}{ \left( x-1 \right) ^{2} \left( {x}^{6}-1 \right) }}
\]
}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{Mcgfs:=simplify(Mcgfsum);
mcgfs:=simplify(mcgfsum);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Mcgfs := 8*x^10*(2*x^2+1)/((x^6-1)*(x^4-1)*(x-1)^2)}{%
\[
{\it Mcgfs}\, := \,8\,{\frac {{x}^{10} \left( 2\,{x}^{2}+1 \right) }{ \left( {x}^{6}-1 \right)  \left( {x}^{4}-1 \right)  \left( x-1 \right) ^{2}}}
\]
}
\mapleinline{inert}{2d}{mcgfs := x^10*(2*x^2+1)/((x^6-1)*(x^4-1)*(x-1)^2)}{%
\[
{\it mcgfs}\, := \,{\frac {{x}^{10} \left( 2\,{x}^{2}+1 \right) }{ \left( {x}^{6}-1 \right)  \left( {x}^{4}-1 \right)  \left( x-1 \right) ^{2}}}
\]
}

\end{maplelatex}
Now we bring the total generating function into "normalized form" with denominator "cdenom"...\begin{mapleinput}
\mapleinline{active}{1d}{num:=numer(Mcgfs):
den:=denom(Mcgfs):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{Magicnum:=expand(simplify(cdenom/den)*num):
Mcgf:=Magicnum/cdenom:}{}
\end{mapleinput}And the symmetry-type generating function ...\begin{mapleinput}
\mapleinline{active}{1d}{num:=numer(mcgfs):
den:=denom(mcgfs):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{magicnum:=(expand(simplify(cdenom/den)*num)):
mcgf:=magicnum/cdenom:}{}
\end{mapleinput}Expand the series to get all values out to "enddegree".The comment symbol # should be used to avoid the long computation associated with large enddegree.  Only the series being printed should be computed.\begin{mapleinput}
\mapleinline{active}{1d}{#Mcgfseries:=series(Mcgf,x=0,enddegree+1):
#print("Total series computed.");}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{#mcgfseries:=series(mcgf,x=0,enddegree+1):
#print("Symmetry-type series computed.");}{}
\end{mapleinput}List the coefficients of each series, i.e., the terms of the counting sequences.
The comment symbol # should be used for controlling the output.  With large "enddegree" the output is huge so it's more convenient to run each sequence's output separately and copy it from the worksheet.Print the sequence of total counts.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
#  co:=coeff(Mcgfseries,x,n):
#  printf("%d  %d \n",n,co); 
od:
print("Coefficients complete.",n,co);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Coefficients complete.", 101, 39992}{%
$\mbox {{\tt ``Coefficients complete.''}},\,101,\,39992$}

\end{maplelatex}
Print the sequence of symmetry counts.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
#  co:=coeff(mcgfseries,x,n):
#  printf("%d  %d \n",n,co);
od:
print("Coefficients complete.",n,co);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Coefficients complete.", 101, 39992}{%
$\mbox {{\tt ``Coefficients complete.''}},\,101,\,39992$}

\end{maplelatex}
First, the generating functions of R_mc(n) and r_mc(n).  The conversion factor is:\begin{mapleinput}
\mapleinline{active}{1d}{rmultiplier:=x\symbol{94}2/(1-x)\symbol{94}2:}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{Rgfs:=simplify(Mcgfs/rmultiplier): 
rgfs:=simplify(mcgfs/rmultiplier): }{}
\end{mapleinput}Now standardize the denominator.  dr = the degree for reduced squares.\begin{mapleinput}
\mapleinline{active}{1d}{dr:=1;
rdenom:=(1-x\symbol{94}p)\symbol{94}(dr+1);}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{num:=numer(Rgfs):
den:=denom(Rgfs):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{Rmagicnum:=simplify(rdenom/den)*num:
Rgf:=Rmagicnum/rdenom;}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{num:=numer(rgfs):
den:=denom(rgfs):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{rmagicnum:=simplify(rdenom/den)*num:
rgf:=rmagicnum/rdenom;}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{dr := 1}{%
\[
{\it dr}\, := \,1
\]
}
\mapleinline{inert}{2d}{rdenom := (1-x^12)^2}{%
\[
{\it rdenom}\, := \, \left( 1-{x}^{12} \right) ^{2}
\]
}
\mapleinline{inert}{2d}{Rgf := 8*(x^10+x^8+x^6+x^4+x^2+1)*(x^4-x^2+1)*(2*x^2+1)*x^8/(1-x^12)^2}{%
${\it Rgf}\, := \,8\,{\frac { \left( {x}^{10}+{x}^{8}+{x}^{6}+{x}^{4}+{x}^{2}+1 \right)  \left( {x}^{4}-{x}^{2}+1 \right)  \left( 2\,{x}^{2}+1 \right) \\
\mbox{}{x}^{8}}{ \left( 1-{x}^{12} \right) ^{2}}}$}
\mapleinline{inert}{2d}{rgf := (x^10+x^8+x^6+x^4+x^2+1)*(x^4-x^2+1)*(2*x^2+1)*x^8/(1-x^12)^2}{%
${\it rgf}\, := \,{\frac { \left( {x}^{10}+{x}^{8}+{x}^{6}+{x}^{4}+{x}^{2}+1 \right)  \left( {x}^{4}-{x}^{2}+1 \right)  \left( 2\,{x}^{2}+1 \right) \\
\mbox{}{x}^{8}}{ \left( 1-{x}^{12} \right) ^{2}}}$}

\end{maplelatex}
Let's generate terms...\begin{mapleinput}
\mapleinline{active}{1d}{Rgfseries:=series(Rgf,x=0,enddegree+1):
print("Reduced series computed.");}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Reduced series computed."}{%
$\mbox {{\tt ``Reduced series computed.''}}$}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{rgfseries:=series(rgf,x=0,enddegree+1):
print("Reduced symmetry-type series computed.");}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Reduced symmetry-type series computed."}{%
$\mbox {{\tt ``Reduced symmetry-type series computed.''}}$}

\end{maplelatex}
List the coefficients of each series, i.e., the terms of the counting sequences.
The comment symbol # should be used for controlling the output.  With large "enddegree" the output is huge so it's more convenient to run each sequence's output separately and copy it from the worksheet.Print the sequence of reduced counts.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
  co:=coeff(Rgfseries,x,n):
  if (modp(n,2)=0) then printf("%d  %d \n",n/2,co); fi:
od:
print("Reduced coefficients complete.",n,co);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
1  0 
2  0 
3  0 
4  8 
5  16 
6  8 
7  24 
8  24 
9  24 
10  32 
11  40 
12  32 
13  48 
14  48 
15  48 
16  56 
17  64 
18  56 
19  72 
20  72 
21  72 
22  80 
23  88 
24  80 
25  96 
26  96 
27  96 
28  104 
29  112 
30  104 
31  120 
32  120 
33  120 
34  128 
35  136 
36  128 
37  144 
38  144 
39  144 
40  152 
41  160 
42  152 
43  168 
44  168 
45  168 
46  176 
47  184 
48  176 
49  192 
50  192 
\mapleinline{inert}{2d}{"Reduced coefficients complete.", 101, 192}{%
$\mbox {{\tt ``Reduced coefficients complete.''}},\,101,\,192$}

\end{maplelatex}
Print the sequence of reduced symmetry counts.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
#  co:=coeff(rgfseries,x,n):
#  if (modp(n,2)=0) then printf("%d  %d \n",n/2,co); fi:
od:
print("Reduced symmetry-class coefficients complete.",n,co);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Reduced symmetry-class coefficients complete.", 101, 192}{%
$\mbox {{\tt ``Reduced symmetry-class coefficients complete.''}},\,101,\,192$}

\end{maplelatex}
The dimension and period for affine magic, and the standard denominator:\begin{mapleinput}
\mapleinline{active}{1d}{da:=2:
pa:=18:
adenom:=(1-x\symbol{94}pa)\symbol{94}(da+1):}{}
\end{mapleinput}See Section 2.2 of "Six Little Squares". We get LattE to spit out two generating functions--one for the polytope P_a:\begin{mapleinput}
\mapleinline{active}{1d}{magicaffp:= (1-t)/(1-t\symbol{94}3) * (1 / ((1-t) * (1-t\symbol{94}3) * (1-t\symbol{94}6))):}{}
\end{mapleinput}... and one for P_a intersect h:\begin{mapleinput}
\mapleinline{active}{1d}{magicaffh:= (1-t)/(1-t\symbol{94}3) * (1 / ((1-t) * (1-t\symbol{94}9))):}{}
\end{mapleinput}From this point on we proceed as above...\begin{mapleinput}
\mapleinline{active}{1d}{openmagicaffp:=simplify(-subs(t=1/x,magicaffp)):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{openmagicaffh:=simplify(subs(t=1/x,magicaffh)):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{magfsum:=openmagicaffp-openmagicaffh;
Magfsum:=8*magfsum;}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{magfsum := -x^12/((x^3-1)^2*(x^6-1))-x^12/((x^3-1)*(x^9-1))}{%
\[
{\it magfsum}\, := \,-{\frac {{x}^{12}}{ \left( {x}^{3}-1 \right) ^{2} \left( {x}^{6}-1 \right) }}-{\frac {{x}^{12}}{ \left( {x}^{3}-1 \right)  \left( {x}^{9}-1 \right) }}
\]
}
\mapleinline{inert}{2d}{Magfsum := -8*x^12/((x^3-1)^2*(x^6-1))-8*x^12/((x^3-1)*(x^9-1))}{%
\[
{\it Magfsum}\, := \,-8\,{\frac {{x}^{12}}{ \left( {x}^{3}-1 \right) ^{2} \left( {x}^{6}-1 \right) }}-8\,{\frac {{x}^{12}}{ \left( {x}^{3}-1 \right)  \left( {x}^{9}-1 \right) }}
\]
}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{Magfs:=simplify(Magfsum);
magfs:=simplify(magfsum);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Magfs := -8*(2*x^3+1)*x^15/((x^9-1)*(x^3-1)*(x^6-1))}{%
\[
{\it Magfs}\, := \,-8\,{\frac { \left( 2\,{x}^{3}+1 \right) {x}^{15}}{ \left( {x}^{9}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}
\]
}
\mapleinline{inert}{2d}{magfs := -(2*x^3+1)*x^15/((x^9-1)*(x^3-1)*(x^6-1))}{%
\[
{\it magfs}\, := \,-{\frac { \left( 2\,{x}^{3}+1 \right) {x}^{15}}{ \left( {x}^{9}-1 \right)  \left( {x}^{3}-1 \right)  \left( {x}^{6}-1 \right) }}
\]
}

\end{maplelatex}
Now we bring the total generating function into "normalized form" with denominator "cdenom"...\begin{mapleinput}
\mapleinline{active}{1d}{num:=numer(Magfs):
den:=denom(Magfs):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{Magicnumaff:=expand(simplify(adenom/den)*num):
Magf:=Magicnumaff/adenom:}{}
\end{mapleinput}And the symmetry-type generating function ...\begin{mapleinput}
\mapleinline{active}{1d}{num:=numer(magfs):
den:=denom(magfs):}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{magicnum:=(expand(simplify(adenom/den)*num)):
magf:=magicnum/adenom:}{}
\end{mapleinput}Now we expand the series to find the values of the counts, up to "enddegree".\begin{mapleinput}
\mapleinline{active}{1d}{#Magfseries:=series(Magf,x=0,enddegree+1):
#print("Total series computed.");}{}
\end{mapleinput}\begin{mapleinput}
\mapleinline{active}{1d}{#magfseries:=series(magf,x=0,enddegree+1):
#print("Symmetry-class series computed.");}{}
\end{mapleinput}List the coefficients of each series, i.e., the terms of the counting sequences.
The comment symbol # is for controlling the output.  With large "enddegree" the output is huge so it's more convenient to run each sequence's output separately and copy it from the worksheet.\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
#  co:=coeff(Magfseries,x,n);
#  if (modp(n,3)=0) then printf("%d  %d \n",n/3,co); fi:
od:
print("Total coefficients complete.",n/3,co);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Total coefficients complete.", 101/3, 192}{%
$\mbox {{\tt ``Total coefficients complete.''}},\,{\frac {101}{3}},\,192$}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{for n from 1 to enddegree do
#  co:=coeff(magfseries,x,n):
#  if (modp(n,3)=0) then printf("%d  %d \n",n,co); fi:
od:
print("Coefficients complete.",n,co);}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{"Coefficients complete.", 101, 192}{%
$\mbox {{\tt ``Coefficients complete.''}},\,101,\,192$}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{}{}
\end{mapleinput}\end{document}
%% End of Maple 9.00 Output