1

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.

Andronicus
  • 3,486
Loli
  • 985
  • 4
    $\sqrt{2}\sin(\pi/4 + n \pi/2)$. – WimC Jan 05 '20 at 10:50
  • 3
    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. – joriki Jan 05 '20 at 10:51
  • 1
    Also: https://math.stackexchange.com/q/2587188/42969, https://math.stackexchange.com/q/2604252/42969, https://math.stackexchange.com/q/2325377/42969. – Martin R Jan 05 '20 at 10:55
  • $\bigl(-1\bigr)^{\lfloor n/2\rfloor}$ is such a closed form. – Bernard Jan 05 '20 at 12:02

2 Answers2

2

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

user
  • 27,958
1

Or using floor:

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

Andronicus
  • 3,486