Tupper's Self-Referential Formula

Author

Eric W. Weisstein
August 25, 2015

This notebook downloaded from http://mathworld.wolfram.com/notebooks/RecreationalMath/TuppersSelf-ReferentialFormula.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/TuppersSelf-ReferentialFormula.html.

©2015 Wolfram Research, Inc. except for portions noted otherwise

Formula

Length[IntegerDigits[n=]]

Reduce

v5.2

Reduce[(1/2)<Floor[Mod[Floor[(y/17)](2^(-17Floor[x]-Mod[Floor[y],17])),2]]&&0<x<107&&n<y<n+17,{x,y},Integers]

...wrong...

v5.2 Workaround

Length[solns={x,y}/.{ToRules[Reduce[(1/2)<Floor[Mod[Floor[(y/17)](2^(-17Floor[x]-Mod[Floor[y],17])),2]]&&0<=x<=105&&n<=y<=n+16&&(x|y)∈Integers,{x,y}]]}]

v6

Length[solns={x,y}/.{ToRules[Reduce[(1/2)<Floor[Mod[Floor[(y/17)](2^(-17Floor[x]-Mod[Floor[y],17])),2]]&&0<=x<=105&&n<=y<=n+16,{x,y},Integers]]}]

Through[{Min,Max}[First/@solns]]

Through[{Min,Max}[Last/@solns]]-n

Show[Graphics[Rectangle[#,#+1]&/@({105-#[[1]],n-#[[2]]}&/@solns)],AspectRatio->Automatic,PlotRange->All]

FindInstance

FindInstance[(1/2)<Floor[Mod[Floor[(y/17)](2^(-17Floor[x]-Mod[Floor[y],17])),2]]&&0<x<107&&n<y<n+17,{x,y},Integers]

Plots

ArrayPlot[Table[Boole[(1/2)<Floor[Mod[Floor[(y/17)](2^(-17Floor[x]-Mod[Floor[y],17])),2]]],{y,n,n+16},{x,105,0,-1}]/.n->]

Generalization

ghurst
2015-08-25

img=ImageCrop[ReplacePixelValue[Binarize@Rasterize[Style["Eric",20,"FontFamily"->"Arial"]],{{12,15}->0,{13,8}->1,{23,19}->1}]]

(Don't think the ReplacePixelValue matters)

img=ImageCrop[Binarize@Rasterize[Style["Eric",20,"FontFamily"->"Arial"]]]

{w,h}=ImageDimensions[img];

Ν=h*
FromDigits[Flatten[Transpose@Reverse[Map[Reverse,ImageData[img]]]],2]

Image[Array[Floor@Mod[Quotient[(#+1+Ν),h]*2^(-h(#2-1)-#+1),2]&,{h,w}]]