3

I was wondering what the rate of growth of the sequence $$1, 2, 2, 3, 3, 3, 4, 4, 4, 4, ...$$ was, and found the related question, Formula for the $n$th term of $1, 2, 2, 3, 3, 3, 4, 4 ,4, 4, 5, ...$, in which one of the answers given is $$a_n = \operatorname{round}{\sqrt {2n}}$$ so the "continuous analog" (not sure if there's a better term) is $\sqrt{2n}$, whose rate of growth turns out to be its reciprocal, $\sqrt{2n}^{-1}$.

But there's no explanation in the aforementioned answer. What are the steps behind going from a discrete sequence to the function that approximates it?

Edit

By trial-and-error, I would have eventually figured it out—even easier if I used hindsight (knowing that the rate of growth is $\sqrt{}$). But how would we characterize a sequence's growth to begin with, to even come up with a guess whose growth matches?

  • basically it's a power series centred around $\infty$ for $\left \lfloor \frac {1+\sqrt{1+8n}}{2} \right \rfloor$ – John Fernley Aug 08 '14 at 21:15
  • 3
    Suppose that the last occurrence of $k$ is in position $n$. Note that $n=1+2+\cdots+k=\frac{k(k+1)}{2}$. This says that $k\approx \sqrt{2n}$. We can also look at the first occurrence of $k$, and with a bit of playing get an explicit expression for number as a function of position. – André Nicolas Aug 08 '14 at 21:29
  • @AndréNicolas - You had the answer first, but unfortunately I didn't understand it until YvesDaoust spelled out the rest of the steps. I see now how the rate of growth can be deduced. – Andrew Cheong Aug 08 '14 at 22:43

3 Answers3

3

This has already been answered in various forms by others earlier but here's my attempt:

$$\begin{align}n&=1,\ \ 2,\ \ 3,\ \ 4,\ \ 5,\ \ 6,\ \ 7,\ \ 8,\ \ 9,\ 10,\ 11,\ 12,...\\ m=f(n)&=1,\ \ 2, \ \ 2, \ \ 3,\ \ 3,\ \ 3,\ \ 4,\ \ 4,\ \ 4,\ \ \ 4, \ \ \ 5,\ \ \ 5,... \\ &\quad \ *\qquad *\qquad \quad\ \ *\qquad \quad \quad \ \ \ \ * \end{align}$$

At positions marked * which occur just before $m$ steps up, $$\begin{align} n&=\lbrace 1, \ 3, \ 6, 10, 15, ...\rbrace\\ m&=\lbrace 1,\ 2,\ 3, \ \ 4, \ \ 5, ... \rbrace\\ \Rightarrow n&=\sum_{i=1}^m i = \frac {m(m+1)}2\\ m^2+m-2n&=0 \\ m=f(n)&=\frac{\sqrt{1+8n}-1}2\end{align}$$ As $m$ steps up 1 each time, for all values of $n$, $m=f(n)$ can be given as $$m=f(n)=\Biggl\lceil{\frac{\sqrt{1+8n}-1}2} \Biggr\rceil $$

Simplifying further by approximation gives

$$\begin{align} m=f(n)&=\Biggl\lceil{}\frac{2\sqrt{2n(1+\frac1{8n})}-1}2 \Biggr\rceil\\ &=\Biggl\lceil{}\sqrt{2n(1+\frac1{8n})}-\frac 12 \Biggr\rceil\\ &\approx \Biggl\lceil{}\sqrt{2n}-\frac 12 \Biggr\rceil \qquad \text{for moderate $n$ and larger }\\ &\approx \text{round}(\sqrt{2n}) \end{align}$$

2

I actually see it as the other way around: the continuous function is used to generate the discrete function. The sequence in the linked answer is discretized from the continuous function.

As for how to find the continuous function, one way is simply by inspection. The sum of the first $n$ odd positive integers is $n^2$, so in between each square we have an increasing number of integers: $1,3,5,7,\dots$. Let's round $\sqrt{n}$ up to the nearest integer, starting with $n=1$:

$$1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, \dots$$

Not quite. Getting rid of every other one might gets us there. So $\sqrt{2n}$ starting with $n=1$:

$$2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, \dots$$

Almost, except we lost the $1$ at the beginning. Maybe start at $n=0$ instead?

$$1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, \dots$$

There it is.

John
  • 26,319
  • Well, yes, I agree that it's more intuitive to see the continuous function as generating the discrete. My question was more, "Given the discrete, how do you find the continuous?" (which you did seem to understand). Now, how did you decide to start at $\sqrt{n}$? Knowing the solution, it would be a very good starting point for trial-and-error, in hindsight. But not knowing the nature of its growth, why would you guess $\sqrt{n}$ to begin with? What I'd like to know is whether there's a way to characterize the growth from only looking at the sequence, to get to the $\sqrt{}$ to begin with. – Andrew Cheong Aug 08 '14 at 22:04
2

Observe that the sequence increases by one unit after $1, 1+2, 1+2+3, 1+2+3+4...$ terms, and more generally, it equals $k$ from the term $\frac{k(k-1)}2\approx\frac{k^2}2$ onwards. (In this particular case, contrary to habit, it turns out to be easier to express the index of the term as a function of the value of the term.)

This shows you the growth rate, $$T_{\frac{k^2}2}=k,$$ or by inversion, $$T_n=\sqrt{2n}.$$