A sequence of numbers is given as: $$1, 2, 2, 3, 3, 3, 4, 4, 4, 4, \text{and so on}$$ (Each integer $n$ is repeated $n$ times.) What will be the 50th term of that sequence?

Let's say $x=50$. Then solving $x=n(n+1)/2$ gives the value of $n$ (rounded off to nearest integer).

My question is: If I make a small change in the above pattern, can we have a direct formula to calculate $n$?

The new pattern is : $$1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, \ldots$$ i.e., $1$ and $2$ are repeated once, and $n$ is repeated $(n-1)$ times.

How can we derive a formula for this pattern?

  • 1
    $\begingroup$ You can ignore the existence of the $1$, and then notice that the sequence $2,3,3,4,4,4,5,5,5,5,\dots$ is simply the sequence where each entry is one more than the corresponding entry in the earlier mentioned sequence. $\endgroup$ – JMoravitz Jan 30 at 19:25
  • $\begingroup$ Yeah i get that, but let's say i'm only provided with 'x' and i need to find the corresponding 'n' for it according to the new sequence $\endgroup$ – Maxy Daen Jan 30 at 19:31

Using JMoravitz hint above, you can replace $x$ with $x-1$ and $n$ with $n-1$ and now your formula is $x-1=(n-1)(n)/2$. Whatever you get for n should be rounded up to the nearest integer if it isn't an integer already.

For example for $x=5$, we have $4 = (n-1)(n)/2 \to 8 = (n-1)(n) \to n^2-n-8=0 \to n=3.37$ which rounds up to 4.

  • 1
    $\begingroup$ Ultimately this amounts to the formula $$ n = \left \lceil \frac 12 (\sqrt{8x - 7} + 1) \right \rceil $$ $\endgroup$ – Omnomnomnom Jan 30 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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