2

Find a formula for the $n$th term of the sequence $$1,2,2,3,3,3,4,4,4,4,\ldots.$$

Let $x_n$ denote the $n$th term of the sequence. If $$1+2+\cdots+m < n \leq 1+2+\cdots+m+(m+1)$$ then $x_n = m+1$. Is this a formula or not?

user19405892
  • 15,592
  • It seems that $$\frac1{1-z}\sum_{n=0}^\infty z^{2^n} $$ should be a generating function, but I don't know how to find a closed form... – Math1000 Oct 02 '16 at 01:37
  • 2
    @Math1000 OEIS says the generating function is $\frac x{1-x}\prod_{k>0}\frac{1-x^{2k}}{1-x^{2k-1}}$. – Parcly Taxel Oct 02 '16 at 02:16
  • Technically this is not a duplicate, since the answer to the question that you actually asked is that it is not a formula. However, what you have is a start on the way to finding a formula, and the accepted answer at the earlier question gives a very complete discussion of how to continue it. – Brian M. Scott Oct 02 '16 at 02:44
  • @Math1000 - F(z) := (z + z^2 + z^4 + z^8 + z^16 + z^32 + z^64)/(1-z); taylor(F(z),z,0,50);

    $$6,z^{50}+6,z^{49}+6,z^{48}+6,z^{47}+6,z^{46}+6,z^{45}+6,z^{ 44}+6,z^{43}+6,z^{42}+6,z^{41}+6,z^{40}+6,z^{39}+6,z^{38}+6,z ^{37}+6,z^{36}+6,z^{35}+6,z^{34}+6,z^{33}+6,z^{32}+5,z^{31}+5 ,z^{30}+5,z^{29}+5,z^{28}+5,z^{27}+5,z^{26}+5,z^{25}+5,z^{24} +5,z^{23}+5,z^{22}+5,z^{21}+5,z^{20}+5,z^{19}+5,z^{18}+5,z^{ 17}+5,z^{16}+4,z^{15}+4,z^{14}+4,z^{13}+4,z^{12}+4,z^{11}+4,z ^{10}+4,z^9+4,z^8+3,z^7+3,z^6+3,z^5+3,z^4+2,z^3+2,z^2+z +\cdots $$

    –  Oct 02 '16 at 04:40
  • @arthur Thanks, that was a classic fallacy of counting $1,2,4,8$ and proceeding to think "powers of $2$!" – Math1000 Oct 02 '16 at 05:44

2 Answers2

0

It should be $\lfloor\sqrt{2n} + \frac{1}{2}\rfloor$, where $n$ is the term number

meta_warrior
  • 3,288
  • 18
  • 34
0

This is not considered a formula, because it does not give $x_n$ as a function of $n$ but instead gives (sharp) bounds on what $x_n$ is. Instead, note that

  • $x_1=1=T_1$ and it is the last $x_n$ equal to 1
  • $x_2=3=T_2$ and it is the last $x_n$ equal to 2
  • $x_3=6=T_3$ and it is the last $x_n$ equal to 3, etc.

Here $T_n$ is the $n$th triangular number. There is an analogue of the square root – the triangular root – that yields $n$ given $T_n$: $$n=\frac{\sqrt{8T_n+1}-1}2$$ Therefore a possible formula for $x_n$ is $$x_n=\left\lceil\frac{\sqrt{8n+1}-1}2\right\rceil$$ Alternatively, this sequence is A002024 in the OEIS and a simpler formula given there is $$x_n=\left\lfloor\sqrt{2n}+\frac12\right\rfloor$$

Parcly Taxel
  • 103,344