2
$\begingroup$

Given the formula $\sum_1^n{i} = \frac{n ( n - 1)}{2} $, does there exist a function $F$ such that $F(n) = i$?

If so, what is it? If not, why not?

  • 0
    Bit of a necro, but I used this today and found that I had to use the ceiling function to make the answer an integer, and also found out that I can't reply vice adding a new answer.2013-04-02

1 Answers 1

4

Maybe you are asking, given $X$, how can I find $n$ such that $\sum_1^ni=X$? or maybe not, it's very hard to tell what you are asking. But if that is what you are asking, here's the answer: multiply $X$ by $8$, add $1$, take the square root, subtract $1$, and divide by $2$.

For example, if $X=45$, you go $45\to360\to361\to19\to18\to9$, and indeed $1+2+\cdots+9=45$.

But your $n(n-1)/2$ should be $n(n+1)/2$.

  • 0
    Exactly what I was looking for. Thank you!2012-03-06