<s>[INST] nth element in the given sequence Given two constants, a and b, and a sequence constructed as follows:
1, 1, 1, 1...(a - 1 times), 2, 2, 2, 2,...(a-2) times,......a-1
For example, for a = 6, 
1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5
Ques: Determine the bth term in the sequence


*

*This is opposite to the sequence given here: Finding the nth element of a sequence
I am not working for a proof here, any pointers to the explanation would help loads. Thank you
 [/INST] Let's flip the sequence to give,
5, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1
Now if we perform, $a-t_n$ for all the terms it gives us,
1, 2, 2, 3, 3, 3.....5
We know the term $t_n = \lfloor \sqrt{2n} + \frac{1}{2} \rfloor$. Our term for the flipped sequence is just $t_n = a-\lfloor \sqrt{2n} + \frac{1}{2} \rfloor$.
The index of the original sequence w.r.t the flipped sequence is $\frac{a(a-1)}{2} - n$. So putting it together,
$$
t_{\left(\frac{a(a-1)}{2} - n\right) } = a-\lfloor \sqrt{2n} + \frac{1}{2} \rfloor $$
Replacing $n$ with $\frac{a(a-1)}{2} - n$,
$$
t_{n} = a-\lfloor \sqrt{2\left(\frac{a(a-1)}{2} - n\right) } + \frac{1}{2} \rfloor $$
</s>