1
$\begingroup$

A closed form for $1, -1, 1, -1, ...$ is $(-1)^n$ for $n=0, 1, 2, ...$ But I can't find a closed form for $1, 1, -1, -1, 1, 1, -1, -1, ...$

That is: take the first two terms to be $1$, then the next two terms to be $-1$, and the next two terms to be $1$ again, and so ...

Is there a closed form of this sequence? I don't know of any result that can help me find it.

$\endgroup$
4
  • 4
    $\begingroup$ $\sqrt{2}\sin(\pi/4 + n \pi/2)$. $\endgroup$
    – WimC
    Commented Jan 5, 2020 at 10:50
  • 3
    $\begingroup$ There was a comment here that clarified the question; now it's gone. Please include the clarification in the question itself. The question shouldn't rely on comments (especially not deleted ones) to be understood. $\endgroup$
    – joriki
    Commented Jan 5, 2020 at 10:51
  • 1
  • $\begingroup$ $\bigl(-1\bigr)^{\lfloor n/2\rfloor}$ is such a closed form. $\endgroup$
    – Bernard
    Commented Jan 5, 2020 at 12:02

2 Answers 2

2
$\begingroup$

One possible form is: $$ (-1)^{\left\lfloor\frac n2\right\rfloor}. $$

$\endgroup$
1
$\begingroup$

Or using floor:

$$(-1)^{\lfloor{\frac{n}{2}}\rfloor}$$

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .