Find another closed form for this sequence

70 Views Asked by At

I've recently come across a sequence while doing math which is:

$$\{1;0;2;-1;3;-2;4;-3;...\}$$

And searching for a closed form to express the n-th therm I've came to the following:

$$a_n=1-(-1)^n\lfloor\frac n2\rfloor$$

But I was wondering if there are another closed form not involving the floor (and related) function(s). Can you help me please ?

2

There are 2 best solutions below

3
On BEST ANSWER

You can write $$\lfloor \frac{n}{2} \rfloor = \frac{n+\frac{(-1)^n-1}{2}}{2}$$

This works because:

  • If $n=2k$, then you get $k=\frac{2k+0}{2}$
  • If $n=2k+1$, then you have $k = \frac{2k+1+(-1)}{2}$

(Moreover, $(-1)^n=\cos(πn)$, if you want to extend this continuously).

In other words:

$$a_n = 1-(-1)^n \left( \frac{n}{2}+\frac{(-1)^n-1}{4} \right) = \frac{3}{4}+\frac{(-1)^n}{4}(1-2n)$$

Extended by continuity, we get:

$\qquad\qquad\qquad$graphe

0
On

You can also write $$ a_n=\frac{3}{4}+(2n-3)\frac{(-1)^n}{4}, $$ which gives first $0,1$ but then your sequence $$1, 0, 2, -1, 3, -2, 4, -3, 5, -4, 6, -5, 7, -6, 8, -7, 9, -8, 10, -9, 11, -10, 12,\ldots $$