nMax = 1024; magScale = 2/3; imagePixels = 600; randomizeMoebiusSign = False; If[ randomizeMoebiusSign, (*** True: define a filter that randomizes the sign of the Moebius function ***) theRandomSeed = 6; (* chosen for its (accidental) good hue match! *) RandomSeed[theRandomSeed]; moebiusFilter := (#*Table[2*RandomInteger[]-1,{Length[#]}])&; titleDescriptor = "random-sign Moebius function"; fileNameSuffix = "randomized";, (*** False: use the canonical Moebius function ***) moebiusFilter := Identity; titleDescriptor = "canonical Moebius function"; fileNameSuffix = "canonical"; ]; (*** compute the Moebius function and (if desired) randomize its signs ***) Table[MoebiusMu[i],{i,nMax}]//moebiusFilter// (*** compute a table of Kalai-normed fourier coefficients ***) Table[ Take[#,n]// (* compute k<=n values by fast transform *) Fourier[#,FourierParameters->{-1,1}]&// (#*Sqrt[n])&// (* extend to k>n values by periodicity *) Table[#[[Mod[i,n,1]]],{i,1,nMax}]&, {n,1,nMax} ]&//Transpose//Reverse// (*** print a few statistics ***) (#//Flatten//Abs//Max//Print[" max |\[Mu]|*Sqrt[n] = ",#]&;#)&// (#//Flatten//Abs//Median//Print["median |\[Mu]|*Sqrt[n] = ",#]&;#)&// (#//Flatten//Abs//Mean//Print[" mean |\[Mu]|*Sqrt[n] = ",#]&;#)&// (#//Flatten//Abs//StandardDeviation//Print[" sdev |\[Mu]|*Sqrt[n] = \[PlusMinus]",#]&;#)&// (*** plot the table ***) ArrayPlot[#, PlotLabel->Style[ "|\[Mu](k,n)| * Sqrt[n]\n"<>titleDescriptor, FontSize->16,FontFamily -> "Helvetica" ], LabelStyle -> Directive[Bold,FontSize->14,FontFamily -> "Helvetica"], FrameLabel->{"1 \[LeftArrow] k -> "<>(nMax//ToString),"1 \[LeftArrow] n -> "<>(nMax//ToString)}, ColorFunctionScaling -> False, ColorFunction -> Function[ {x}, Hue[ x//Arg//(#/(2*Pi))&//Mod[#+1/2,1]&, (x/magScale//Abs)//Sqrt//Min[#,1]&, (x/magScale//Abs)//Sqrt//Min[#,1]& ] ] ]&// (*** rasterize the plot ***) Rasterize[#, RasterSize->imagePixels, Background->White ]&//( (*** export the figure ***) Export["~/Desktop/Moebius_"<>"_"<>(nMax//ToString)<>"_"<> fileNameSuffix<>".png", #,"png", ImageSize -> imagePixels ]; # )&