Given a set $S$ of size $n$, there is a maximum number of disjoint subsets where the size of each of the subsets is larger than zero and different for each of the subsets. Which is obtained by counting the number of times $(k)$ we must add up the sequence of integers starting at 1, where at each addition we increase the number by which we add with one, until the our sum is larger than $n$, and then taking $k-1$.
For example, if $n = 11$ we find that the maximum number of subsets is obtained by summing 1 + 2 + 3 + 4 + 5 = 15 > 11, e.g. k = 5, and the maximum number of subsets with different sizes for $n = 11$ is 4.
My question is if there exists a simple expression for this number that does not require to iteratively sum until some condition is reached?
A more elegant representation of the problem (thanks ab123) is which expression gives back the the maximum value for $i$ in under the constraint that:
$$ i(i+1) \leq 2n $$
This function should for $n$ is 1:15 return the following answers:
$1,1,2,2,2,3,3,3,3,4,4,4,4,4,5$