Ok so I have this pattern
[1]0-50
[2]51-150
[3]151-300
[4]301-500
[5]501-750
[6]751-1050
[7]1051-1400
etc forever
What I need is to be able to take in the second number and get the associated first number.
Examples of answers
in out
12 -> 1
101 -> 2
841 -> 6
I could do this using recursion(this is for a program), but I'd rather not waste cycles on it, and I'm sure there is a solution, I just don't have the mental maths tools to solve it.
The upper boundary for group $n$ is $25(n)(n+1)$ so you could check it against that.
\begin{array}{|c|c|c|} \hline \text{Group}& 25\times(n)\times(n+1) & \text{Upper Limit}\\ \hline \text{1} & 25(1)(2) &50 \\ \hline \text{2} & 25(2)(3) &150 \\ \hline \text{3} & 25(3)(4) &300 \\ \hline \text{7} & 25(7)(8) &1400 \\ \hline \end{array}
For example, solve $841=25(n)(n+1)$ and get $n\approx5.32$ and round up to 6.
You an solve with the quadratic equation $25n^2+25n-A=0$ so $${n = \frac{{ - 25 \pm \sqrt {25^2 - 4(25)(-A)} }}{{50}}} \\{n = \frac{{ - 25 + \sqrt {625 - 100(-A)} }}{{50}}}$$
So, whatever your number is, say $A=841$, you can say, $$n=(\sqrt{(A*100)+625}-25)/50\\5.32\approx(\sqrt{(841*100)+625}-25)/50$$
Basically, $n=(\sqrt{(A*100)+625}-25)/50$ is going to be your formula and you will always round up your answer. Or use the ceiling function of it.
Also, the formula given by user2345215 works as well and is simplified.