As already pointed out in comments, $\left\lfloor\dfrac{n^2}{n+1}\right\rfloor$ is just $n-1$ in disguise.
And you are asked to calculate $\displaystyle S=\sum\limits_{k=1}^n(k-1)2^k$
Notice that if we change $2$ by $x$ we get
$\displaystyle\begin{align} S(x)&=\sum\limits_{k=1}^n(k-1)x^k=x^2\sum\limits_{k=1}^n(k-1)x^{k-2}=x^2\sum\limits_{k=1}^n\Big(x^{k-1}\Big)'=x^2\Bigg(\sum\limits_{k=1}^n x^{k-1}\Bigg)'\\\\
&=x^2\Bigg(\sum\limits_{k=0}^{n-1} x^k\Bigg)'=x^2\bigg(\frac{x^n-1}{x-1}\bigg)'=\frac{(nx^2-nx-x^2)\,x^n+x^2}{(x-1)^2}\end{align}$
Note: sums are finite so exchanging sum and derivation is not an issue, just regular stuff expressed in condensed form.
Now of course we substitute back $x=2$ to get
$S(2)=(2n-4)\,2^n+4=(n-2)\,2^{n+1}+4$
And $n=2024$ is clearly solution.
Note for the future:
When you will see sums later with terms in $nx^n$ or $n^2x^n$ or $\frac {x^n}n$ and so on, think about derivating once, twice or integrating the geometric $g(x)=\sum\limits_{k=0}^{n-1}x^k=\dfrac{x^n-1}{x-1}$
For instance rewrite
$nx^n=xnx^{n-1}=x(x^{n})'$
$n^2x^n=x^2n(n-1)x^{n-2}+xnx^{n-1}=x^2(x^{n})''+x(x^n)'$
$\dfrac{x^n}{n}=\int x^{n-1}$
And so on...
You will need to pay attention to starting indices though, but apart from that this is the general technique for such sums.
$\times$for $\times$. – Shaun Feb 25 '24 at 14:14