A228287 Smallest value of z in the minimal value of x + y*z, given x*y + z = n (where x, y, z are positive integers).
1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 2, 3, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1
Offset: 2
Keywords
Examples
For n = 215 the triples (53, 4, 3) and (35, 6, 5) both give the minimal value of x + yz = 65. Thus a(215) = 3.
Crossrefs
Cf. A228286.
Programs
-
Maple
A228287 := proc(n) local a,x,y,z,zfin ; a := n+n^2 ; zfin := n ; for z from 1 to n-1 do for x in numtheory[divisors](n-z) do y := (n-z)/x ; if x+y*z < a then a := x+y*z ; zfin := z ; end if; end do: end do: return zfin; end proc: # R. J. Mathar, Sep 02 2013
-
Mathematica
A228287[n_] := Module[{a, x, y, z, zfin}, a = n + n^2; zfin = n; Do[Do[y = (n-z)/x; If[x + y*z < a, a = x + y*z; zfin = z], {x, Divisors[n-z]}], {z, 1, n-1}]; zfin]; Table[A228287[n], {n, 2, 100}] (* Jean-François Alcover, Aug 08 2023, after R. J. Mathar *)
Comments