# Code Producing FindMinimum::nrnum; how do we fix it?

Suppose $$A=\left\{\sqrt{m}:m\in\mathbb{N}\right\}$$ and $$S\subseteq A$$:

I wish to create a code which finds:

$$\min\left\{c:\forall(d\in S)\exists(c\in A)\left(c/d\in A\right),\max(S)\le c \le \prod\limits_{i\in S}i\right\}$$

for instance, with $$S=\left\{\sqrt{2},\sqrt{3},\sqrt{4}\right\}$$, the code should give $$\sqrt{12}$$

With Mathematica, I tried:

Clear["Global*"]
S = {Sqrt[2], Sqrt[3], Sqrt[4]}
lcm[x_] :=
lcm[x] = FindMinimum[{Total[Boole /@ IntegerQ /@ ((c/x)^2)] ==
Length[x] && Max[x] <= c <= Times @@ x}, {d}]
lcm[S]


but the output gives an error of:

FindMinimum::nrnum: The function value False is not a real number at {c} = {1.}.

FindMinimum::nrnum: The function value False is not a real number at {c} = {1.}.


How do we fix this so the code gives $$\sqrt{12}$$

• Use the function Min for finite sets, not FindMinimum`.