One must somehow wight the two goals, normally this is done by practical considerations (economical, physical) etc.
In[36]:= With[{\[Alpha] = 0.01, \[Beta] = 0.99},
Minimize[{\[Alpha] (N1 + N2) + \[Beta] (N1 N2/(n1 n2) - 17.3)^2,
N1 > 17 && N2 > 23 && n1 > 19 && n2 > 19 && n1 != n2 && GCD[N1, N2] == 1}, {N1, N2, n1, n2}, Integers]
]
Out[36]= {1.7502, {N1 -> 74, N2 -> 99, n1 -> 21, n2 -> 20}}
In[39]:= GCD[74, 99]
Out[39]= 1
In[40]:= (74. 99.)/(21 20)
Out[40]= 17.4429
N1 and N2 must be around Sqrt[17.3] bigger tha n1 and n2 respectively. The Alpha must be small enough to make the 17.3 condition a pretender against the teeth number. In the contrary, with big Alpha and small Beta the 17.3 condition looses its relevance, still it is a Minimize[]
In[58]:= With[{\[Alpha] = 0.9, \[Beta] = 0.1},
Minimize[{\[Alpha] (N1 + N2) + \[Beta] (N1 N2/(n1 n2) - 17.3)^2,
N1 > 17 && N2 > 23 && n1 > 19 && n2 > 19 && n1 != n2 &&
GCD[N1, N2] == 1}, {N1, N2, n1, n2}, Integers]
]
Out[58]= {64.9903, {N1 -> 19, N2 -> 24, n1 -> 21, n2 -> 20}}
Regards
Udo.