{VERSION 6 0 "IBM INTEL LINUX" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT -1 33 "Affine Count of 3x3 Magic Square s" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 147 "We calculate the number of s trongly magic squares with magic sum k (Ma[k]) and check it against th e coefficients of the generating function (Mgf). " }}{PARA 0 "" 0 "" {TEXT -1 249 "Minimum and maximum value of k in all calculations. The maximum reflects the fact that the quasipolynomial has degree 2 (thus 3 coefficients) and the period is known from geometry to be at most 1 8. Thus there are (at most) 54 unknown coefficients." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "mink:=3: maxk:=72:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 119 "Step size (this could be a trial period). The value of \+ 3 reflects the fact that the magic sum must be a multiple of 3." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "step:=3:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "The generating function of magic squares, computed elsewh ere." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "Mgf := -8*(2*x^3+1)*x^15/(x ^9-1)/(x^3-1)/(x^6-1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$MgfG,$*. \"\")\"\"\",&*&\"\"#F()%\"xG\"\"$F(F(F(F(F(F-\"#:,&*$)F-\"\"*F(F(F(!\" \"F4,&*$F,F(F(F(F4F4,&*$)F-\"\"'F(F(F(F4F4F4" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "Mgfseries:=series(Mgf,x=0,maxk+step); " }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%*MgfseriesG+M%\"xG\"\")\"#:\"#C\"#=\"#K\"# @\"#cF)\"#!)\"#F\"$/\"\"#I\"$O\"\"#L\"$w\"\"#O\"$3#\"#R\"$c#\"#U\"$/$ \"#X\"$_$\"#[\"$3%\"#^\"$s%\"#a\"$G&\"#d\"$+'\"#g\"$s'\"#j\"$W(\"#m\"$ C)\"#p\"$7*\"#s-%\"OG6#\"\"\"\"#v" }}}{EXCHG }{EXCHG {PARA 0 "" 0 "" {TEXT 256 30 "Count the affine magic squares" }}{PARA 0 "" 0 "" {TEXT -1 173 "This is the raw data calculated using the standard 8-fold symm etry to reduce the computation. We assume x[1] is the largest corner \+ and x[3] is the next largest (as in SLS)." }}{PARA 0 "" 0 "" {TEXT -1 104 "Note that the tests of equality are redundant insurance that can \+ be omitted (as shown here) for speedup." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 398 "for k from mink to maxk by step do \n x[5]:=k/3: \n ma[k]:= 0: \n for b from 1 to x[5]/2 do\n for a from b+1 to x[5]-b-1 do \n if( a-b<>b ) then \n x[1]:=x[5]+a: \n x[2]:=x[5]-a -b: \n x[3]:=x[5]+b: \n x[7]:=k-x[5]-x[3]: \n x[8 ]:=k-x[5]-x[2]: \n x[9]:=k-x[5]-x[1]: \n x[4]:=k-x[1]-x[ 7]: \n x[6]:=k-x[5]-x[4]:\n eq := x[7]=x[1] or x[7]=x[4] ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 199 "# eq:= eq or (x[5]=x [2]) or (x[5]=x[4]) or (x[6]=x[3]) or (x[6]=x[4]) or (x[6]=x[5]) or (x [8]=x[2]) or (x[8]=x[5]) or (x[8]=x[7]) or (x[9]=x[3]) or (x[9]=x[6]) \+ or (x[9]=x[7]) or (x[9]=x[8]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 404 " # eq:= eq or (x[4]=x[3]) or (x[5]=x[1]) or (x[5]=x[3]) or (x[ 6]=x[1]) or (x[6]=x[2]) or (x[7]=x[1]) or (x[7]=x[2]) or (x[7]=x[3]) o r (x[7]=x[4]) or (x[7]=x[5]) or (x[7]=x[6]) or (x[8]=x[1]) or (x[8]=x[ 3]) or (x[8]=x[4]) or (x[8]=x[6]) or (x[9]=x[1]) or (x[9]=x[2]) or (x[ 9]=x[4]) or (x[9]=x[5]):\n if not eq then \n ma[k] :=ma[k]+1: \n else print(eq,a,b); \n fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "# else print(\"Bad square\", x); " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 192 " fi: \n od:\n od:\n Ma[k ]:=8*ma[k]: \n M[k]:=coeff(Mgfseries,x^k): \n if( Ma[k]=M[k] ) then \+ \n print(k,Ma[k],\"Consistent\"):\n else \n print(k,Ma[k],M[k], \"Inconsistent\"): \n fi: \nod:" }}{PAGEBK }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"$\"\"!Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"'\"\"!Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\" \"*\"\"!Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#7\"\"!Q+ Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#:\"\")Q+Consistent 6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#=\"#CQ+Consistent6\"" }} {PARA 11 "" 1 "" {XPPMATH 20 "6%\"#@\"#KQ+Consistent6\"" }}{PARA 11 " " 1 "" {XPPMATH 20 "6%\"#C\"#cQ+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#F\"#!)Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#I\"$/\"Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"# L\"$O\"Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#O\"$w\"Q+ Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#R\"$3#Q+Consistent 6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#U\"$c#Q+Consistent6\"" }} {PARA 11 "" 1 "" {XPPMATH 20 "6%\"#X\"$/$Q+Consistent6\"" }}{PARA 11 " " 1 "" {XPPMATH 20 "6%\"#[\"$_$Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#^\"$3%Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#a\"$s%Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#d \"$G&Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#g\"$+'Q+Con sistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#j\"$s'Q+Consistent6\" " }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#m\"$W(Q+Consistent6\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#p\"$C)Q+Consistent6\"" }}{PARA 11 "" 1 " " {XPPMATH 20 "6%\"#s\"$7*Q+Consistent6\"" }}}{EXCHG }{EXCHG }}{MARK " 6 2 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }