%I #6 Oct 12 2019 06:31:48
%S 1,1,1,2,1,2,1,2,3,2,1,2,1,2,3,2,1,3,1,2,3,2,1,3,5,2,3,2,1,3,1,4,3,2,
%T 5,3,1,2,3,4,1,3,1,2,3,2,1,4,7,5,3,2,1,3,5,4,3,2,1,4,1,2,3,4,5,3,1,2,
%U 3,5,1,4,1,2,5,2,7,3,1,4,3,2,1,4
%N Second greatest (or second least) edge length of a cuboid having integer edge lengths, volume n and minimal surface area under those restrictions.
%C Finding a(n) given n is a fundamental problem from integer nonlinear programming, equivalent to minimizing the sum a+b+c when a*b*c=n and a,b,c are integers. a(n) is not strictly prime. a(n) = 1 iff n is prime (a(1)=1). a(n) <= n^(1/2) for all n.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Cuboid.html">Cuboid</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SampleVariance.html">Sample Variance</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Nonlinear_programming">Nonlinear Programming</a>
%e a(10) = 2 because the cuboid of integer edge lengths, volume = 10 and minimal possible surface area under those restrictions has edge lengths {5,2,1}
%t Clear[fac, faclist, red, bool, n, a, b, c, i, ai, bi, ci]
%t red[n_] := Reduce[{a*b*c == n, a >= b >= c > 0}, {a, b, c}, Integers];
%t faclist[n_] := (
%t If[PrimeQ[n] || n == 1, Return[{n + 1 + 1, {n, 1, 1}}]; Abort[]];
%t bool = red[n];
%t Reap[For[i = 1, i <= Length[bool], i++,
%t ai = bool[[i]][[1]][[2]];
%t bi = bool[[i]][[2]][[2]];
%t ci = bool[[i]][[3]][[2]];
%t Sow[{ai + bi + ci, {ai, bi, ci}}]]][[2]][[1]])
%t fac[n_] := (
%t If[PrimeQ[n] || n == 1, Return[{n, 1, 1}]; Abort[]];
%t faclist[n][[1]][[2]])
%t Table[fac[k][[2]], {k, 1, 84}]
%Y Cf. A102095, A102097.
%K nonn
%O 1,4
%A Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 29 2004