Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Is there an analytic form of a function that satisfies the following:

$$\begin{align*} f:\mathbb N &\to \mathbb N\\ 1&\mapsto 1\\ 2&\mapsto 2\\ 3&\mapsto 2\\ 4&\mapsto 3\\ 5&\mapsto 3\\ 6&\mapsto 3\\ 7&\mapsto 4\\ &\vdots \end{align*}$$

share|improve this question
1  
If you have the $n$th triangular number $T_n$ that is the smallest triangular number equal to or larger than $m$, note that $f(m)=n$. –  Alyosha Apr 11 '13 at 16:27

1 Answer 1

up vote 2 down vote accepted

Assuming $f(n)=4$ for $7 \le n \le 10$ (so there are $4 \ \ 4$'s and so on) you are finding the minimum $m$ such that $\frac 12 m(m+1) \ge n$, which is a triangular number. To get an explicit formula, we can invert $\frac 12 m(m+1) = n$ by saying $ m^2+m-2n=0, m=\frac 12(-1+\sqrt{1+8n})$ and rounding up: $$m=\left\lceil\frac 12\bigg(-1+\sqrt{1+8n}\bigg)\right\rceil$$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.