<s>[INST] What is nth number on this series? I have series of
1+5+12+22+.....

where d=3n+1 where n=0,1,2...

but i can not find the nth number on this series ? can anyone explain how to get nth number on this series?
 [/INST] We have $$T_1 =1$$ $$T_2 =5 =1+4$$ $$T_3 = 12 = 1+4+(4+3) $$ $$T_4 =22 =1+4+ (4+3) + (4+3+3) $$ $$T_5 =35 = 1+4+(4+3)+(4+3+3)+(4+3+3+3) $$ $$\vdots $$
We can thus write $$T_n = 1 + 4 +(4+3) +(4+2\times 3) + \cdots +(4+(n-2)\times 3) $$ $$= 1 + (n-1)\times 4 + (1+2+3+\cdots + (n-2))\times 3$$ $$=1+(n-1)\times 4 + (\sum_{i=1}^{n-2} i)\times 3$$ $$=1+(4n-4) + 3(\frac {(n-2)(n-1)}{2})$$ $$ = (4n-3) + \frac {3n^2-9n+6}{2}$$ $$\boxed {T_n = \frac {3n^2-n}{2}} $$
Hope it helps. 
</s>