-1

How to deal with sequences like $$1,2,2,3,3,3,4,4,4,4,........$$ Now they don't come under any specific sequence (A.P., G.P. or H.P.). Can we deduce any simple formula or working method to deduce their $n^{th}$ term and the sum upto $n^{th}$ Any kind of hint would certainly work.

Harsh Sharma
  • 2,369
  • 1
    You could try OEIS, which offers 52 such sequences. You probably want A002024 or something close to it – Henry Nov 14 '16 at 06:31
  • When does the number $k+1$ occur in the sequence for the first time? After $k$ is exhausted, which occurs after $k-1$ is exhausted. So you can find the formula when a particular number makes its first and last appearance in this sequence. – P Vanchinathan Nov 14 '16 at 06:43

2 Answers2

2

each number $ n > 1$ appears for the first time in the sequence after $ \sum_{k<n} k$ iterations. Meaning that n will appear for the first time at $\frac{n(n-1)}{2} + 1$ th term and will appear for the last time at $\frac{n(n+1)}{2}$. So in order to deduce the kth term, you must find a certain $n$ that satisfies $ \frac{n(n-1)}{2} + 1 \leq k \leq \frac{n(n+1)}{2} $ For the sum , once you find your $n$ , we can easily deduce that we are actually summing the squares of natural numbers, up to (n-1), and adding $n$,$ k- \frac{n(n-1)}{2}$ times Hence, the $S(k) = \sum_{i < n } i^{2} + n * (k-\frac{n(n-1)}{2}) $ where $ \frac{n(n-1)}{2} + 1 \leq k \leq \frac{n(n+1)}{2} $

W.314
  • 348
1

What is wanted is a function such that $f(n+1)-f(n) = n$ so that each term is $n$ further. You then want to find the inverse of this function to get the value.

An obvious choice is $f(n) = n(n-1)/2$. To find the inverse, solve $y = x(x-1)/2$ for $x$. You can use the quadratic formula (in $x^2-x-2y = 0$) or note that $8y = 4x^2-4x =(2x-1)^2-1 $ so $x = \dfrac{1 \pm\sqrt{8y+1}}{2} $. Since this has to be positive, the positive root is required, so $x = \dfrac{1 +\sqrt{8y+1}}{2} $.

Finally, we need the integer part, so $x = \bigg\lfloor\dfrac{1 +\sqrt{8y+1}}{2}\bigg\rfloor $.

As a check, here are the values for $y$ from 0 to 20:

{1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6}

marty cohen
  • 107,799