I apologize for forgetting all my high school math!
How can I get the reverse of a summation?
$$x = \frac{n ( n + 1 )}{2}$$
I know that with basic algebra I can do:
$$\sqrt{2x - n} = n$$
But obviously, I need the $n$ on the other side :(
I apologize for forgetting all my high school math!
How can I get the reverse of a summation?
$$x = \frac{n ( n + 1 )}{2}$$
I know that with basic algebra I can do:
$$\sqrt{2x - n} = n$$
But obviously, I need the $n$ on the other side :(
I believe you are trying to solve for $n$ while knowing $x=\frac{n(n+1)}{2}$. If so, then you are solving quadratic equation $n^2+n-2x=0$. This equation has two solutions $\frac{1}{2}(-1-\sqrt{1+8x})$ and $\frac{1}{2}(-1+\sqrt{1+8x})$.
For a quick and dirty way to find $n$ given $x$:
Multiply $x$ by 2, take the square root, and round down to the nearest number.
This always works, since $2x = n(n+1)$, so the square root will always be between $n$ and $n+1$.