Fermat's Sandwich Theorem

Author

Eric W. Weisstein
May 22, 2009

This notebook downloaded from http://mathworld.wolfram.com/notebooks/DiophantineEquations/FermatsSandwichTheorem.nb.

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

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

Enumeration

PerfectCubeQ[n_Integer]:=IntegerQ[(n^(1/3))]
PerfectSquareQ[n_Integer]:=IntegerQ[Sqrt[n]]

Select[Range[10^5],(PerfectSquareQ[#-1]&&PerfectCubeQ[#+1]&)]//Timing

Select[Range[10^5],(PerfectSquareQ[#+1]&&PerfectCubeQ[#-1]&)]//Timing

Proof

Reduce[n^2+1==m^3-1&&0<n&&0<m,{n,m},Integers]

Reduce[n^2+1==m^3-1&&0<n<100&&0<m<100,{n,m},Integers]

Reduce[n^2-1==m^3+1&&0<n&&0<m,{n,m},Integers]

Reduce[n^2-1==m^3+1&&0<n<100&&0<m<100,{n,m},Integers]