I tried to solve the wave equation:

After some calculation I reached at this step where I have to find the constant alpha.

- For even value of n alpha is 0
- For n = 1, 3, 9, 11, 17, 19 . . . . . . alpha is $\sqrt{2}$
- For n = 5, 7, 13, 15, 21, 23 . . . . . . alpha is $-\sqrt{2}$
Can anyone help me to find the general term for 2 and 3? I tried my best but failed. Please help. I want something like $\frac{{(-1)^{something}}8\sqrt{2}}{{\pi^2}{n^2}}$
General term is:
$$f(x) = {-1}^{\lfloor2\{x / 8 \} \rfloor +1} $$
Here is the proof.
As mentioned by me in the comments the first row contains numbers of the form $8k+1,8k+3$ and the second row contains numbers of the form $8k+5,8k+7$
Case 1: First Row
8k+1 or 8k+3
{(8k+1)/8} or {(8k+3)/8} = 0.125 or 0.375
2{(8k+1)/8} or 2{(8k+3)/8} = 0.25 or 0.75
When you take the floor function it becomes 1 because floor(0.25 or 0.75) = 1
Therefore ${-1}^2 = 1$
Case 2: 2nd Row
{(8k+5)/8} or {(8k+7)/8} = 0.625 or 0.875
2{(8k+1)/8} or 2{(8k+3)/8} = 1.25 or 1.75
When you take the floor function it becomes 1 because floor(1.25 or 1.75) = 2
Therefore ${-1}^3 = -1$