I came up with the following inequality, but I am not able to prove it, despite the plots suggesting that the following inequality is true: $$-\gamma x^2 ( x^{k/\gamma}-1 ) -x^2 + \alpha x - \alpha + 1 \leq 0,\qquad\ 2 \leq x \leq n-1.$$
Let me explain this inequality in more details since I used some notations to simplify it.
$n \geq 3$ is an integer, and so is $2 \leq x \leq n-1$. For the purpose of the proof, it might be easier to consider that $x$ is a real number.
$\alpha = \alpha(n) = \left \lceil \frac{n}{\log n} \right \rceil$ depends only on $n$.
$\gamma = \gamma(n, x)$ is actually a function of $n$ and $x$ defined by $$\gamma(n,x) = n \cdot \frac{x + W(-xe^{-x})}{x}$$ where $W(z)$ is the Lambert's $W$ function.
$k = k(n,x)$ is also a function of $n$ and $x$ defined by $$k(n,x) = \frac{\log \left( \frac{\log(n) - 1}{\log n} \right)}{\log \left( \frac{n - x}{n} \right)}.$$
Now that my notations are fixed, let $n \geq 3$ be fixed. How can I prove that $$-\gamma x^2 ( x^{k/\gamma}-1 ) -x^2 + \alpha x - \alpha + 1 \leq 0,\ 2 \leq x \leq n-1?$$
Here's a plot depicting what's happening:

I tried to derive the function $f(x) = -\gamma x^2 ( x^{k/\gamma}-1 ) -x^2 + \alpha x - \alpha + 1$, but since on the plots $f$ is not strictly decreasing, that was not very useful (also the derivative is ugly).
So do you have any hints/idea on what I could try to prove this?