<s>[INST] Consider $A$ the set of natural numbers with exactly 2019 divisors Consider $A$ the set of natural numbers with exactly 2019 divisors, and for each $n  \in A$ denote
$$
S_n = \frac{1}{d_1+\sqrt{n}} + \frac{1}{d_2+\sqrt{n}} + ... + \frac{1}{d_{2019}+\sqrt{n}},
$$
where $d_1, d_2, \dots, d_{2019}$ are the divisors of $n$. Find the maximum value of $S_n$.
I started off with the theorem where the number of divisors of a number can be found by adding one to all the exponents and then multiplying them which means each divisor is either $p^{2018}$, $p^2$, or $p^{672}$ because $2019 = 3\times 673$. Thank you for helping out!
Edit: I've made some progress. To minimize the denominators, we must make n as small as possible, and by the # of divisors formula, the smallest possibility would be $$n = 2^{672} * 3^2$$
Now, I just need to figure out how to sum this with that giant equation.
 [/INST] As $n$ has exactly $2019 = 3 \times 673$ divisors. So, $n$ must be written as
$$n = a^{673-1}b^{3-1} = a^{672}b^2$$
with $a\ne b$ and $a,b\ge 2$. (We notice that $n$ here is a square number.)
For each divisor $x$ of $n$, $\frac{n}{x}$ is also its divisor. There are in total $\frac{2018}{2} =  1009$ couples $(x,\frac{n}{x})$ with  $x<\frac{n}{x}$  (or $x < \sqrt{n}$) and one term $x = \sqrt{n} = a^{336}b$.
For each couple $(x,\frac{n}{x})$, we compute
$$\frac{1}{x+\sqrt{n}}+\frac{1}{\frac{n}{x}+\sqrt{n}} =\frac{\sqrt{n}}{\sqrt{n}(x+\sqrt{n})}+\frac{x}{\sqrt{n}(x+\sqrt{n})} = \frac{1}{\sqrt{n}}$$
So, in total, the sum $S_n$ is equal to
$$
\begin{align}
S_n &= \frac{1009}{\sqrt{n}}+\frac{1}{\sqrt{n}+\sqrt{n}} \\
&= \frac{2019}{2}\frac{1}{\sqrt{n}} \\
&= \frac{2019}{2}\frac{1}{a^{336}b}  \le \frac{2019}{2}\frac{1}{2^{336}3} =\frac{673}{2^{337}}
\end{align}
$$
Hence, $S_n$ reaches its maximum of $\frac{673}{2^{337}}$ if and only if $n = 2^{672}3^2$.
Q.E.D
</s>