Brocard's Problem

Author

Eric W. Weisstein
December 5, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/BrocardsProblem.nb.

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

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

Original Problem

Flatten[Position[1+Range[1000]!,_?(IntegerQ[Sqrt[#]]&)]]//Timing

Wilson's Extension

leastsq[n_]:=Module[{k=1},
While[!IntegerQ[Sqrt[n!+k^2]],k++];
k
]

Table[leastsq[i],{i,4,15}]