Solution 1:

Why would you expect to get the optimal answer? You used the inequality $\ln n < n$ which is a very loose inequality when $n$ is big. The inequality $\ln n <n^{1/2}$ is also true for all $n\ge 1$ and is tighter, so it will give you a better bound for $p$.

In general, when you use an inequality to bound a function you lose some precision in exchange of working with a function that is easier to manipulate, so it's completely normal not to get the optimal behavior unless the bound is, in some sense, tight.