New Reply

Need to figure out a formula that calculates -1,-1,+1,+1,-1,-1,+1,+1...

 
Share Thread
Jul1-12, 03:44 PM   #1
 

Need to figure out a formula that calculates -1,-1,+1,+1,-1,-1,+1,+1...


So I need a formula that calculates -1,-1,+1,+1,-1,-1,+1,+1,... for a value of n that is not a piece wise.

So far I have come up with (-1)^[2n/3] but I don't like using greatest integer

I also did:
[cos(n × ∏)]!
The notation is not setup correctly and anyone that knows how to do it proper let me know. It is supposed to function like this:

cos(n∏)cos((n-1)∏)cos((n-2)∏)cos((n-3)∏)... until cos((n-n)∏)

I have dug in algebraically but don't think there is a solution, anyone have any thoughts on this?
PhysOrg.com mathematics news on PhysOrg.com

>> Pendulum swings back on 350-year-old mathematical mystery
>> Bayesian statistics theorem holds its own - but use with caution
>> Math technique de-clutters cancer-cell data, revealing tumor evolution, treatment leads
Jul1-12, 04:20 PM   #2
 
-cos(n*pi/2) --> -1, 0, 1, 0 ...
-sin(n*pi/2) --> 0, -1, 0, 1 ...
Jul1-12, 04:58 PM   #3
 
The period for your sequence is 4, so it is represented as a discrete fourier series:
[tex]
x_n = \sum_{m = 0}^{3}{a_{m} \, \exp \left(\frac{2 \pi i \, m \, n}{4} \right)},
[/tex]
where the coefficients are found from:
[tex]
a_{m} = \frac{1}{4} \, \sum_{n = 0}^{3}{x_{n} \, \exp \left(-\frac{2 \pi i \, m \, n}{4} \right)}
[/tex]

Do the calculation by using [itex]x_0 = x_1 = -1, x_2 = x_3 = +1[/itex] for [itex]a_{0,1,2,3}[/itex], and express the complex exponentials via trigonometric functions through the Euler identity:
[tex]
e^{i \alpha} = \cos \alpha + i \sin \alpha
[/tex]
Jul1-12, 06:22 PM   #4
 

Need to figure out a formula that calculates -1,-1,+1,+1,-1,-1,+1,+1...


Quote by Dickfore View Post
The period for your sequence is 4, so it is represented as a discrete fourier series:
[tex]
x_n = \sum_{m = 0}^{3}{a_{m} \, \exp \left(\frac{2 \pi i \, m \, n}{4} \right)},
[/tex]
where the coefficients are found from:
[tex]
a_{m} = \frac{1}{4} \, \sum_{n = 0}^{3}{x_{n} \, \exp \left(-\frac{2 \pi i \, m \, n}{4} \right)}
[/tex]

Do the calculation by using [itex]x_0 = x_1 = -1, x_2 = x_3 = +1[/itex] for [itex]a_{0,1,2,3}[/itex], and express the complex exponentials via trigonometric functions through the Euler identity:
[tex]
e^{i \alpha} = \cos \alpha + i \sin \alpha
[/tex]
I am not familiar with this. What does it do?
It looks complex.
Jul2-12, 07:41 AM   #5
 
Recognitions:
Gold Membership Gold Member
[tex]
i^{(n)(n+1)}
[/tex]
Jul2-12, 08:05 AM   #6
 
Recognitions:
Homework Helper Homework Help
Quote by coolul007 View Post
[tex]
i^{(n)(n+1)}
[/tex]
Nice and simple.
Jul2-12, 09:05 AM   #7
 
nice solution, need to mention for all n>0.
Jul2-12, 11:38 AM   #8
 
Quote by coolul007 View Post
[tex]
i^{(n)(n+1)}
[/tex]
That's awesome :)
I played with [tex]i[/tex] but gave up on it (apparently too quickly!)
Very simple solution
Jul2-12, 02:31 PM   #9
 
You can usually get sin or cos to get you a periodic sequence nicely, especially if you don't want to use i, so here's one more way:[tex]\sqrt{2}\cos\left(\frac{\pi}{4} + \frac{n\pi}{2}\right)[/tex]
Jul2-12, 03:09 PM   #10
 
or my solution: cos(n*pi/2 + pi) + sin(n*pi/2 + pi)
New Reply

Similar discussions for: Need to figure out a formula that calculates -1,-1,+1,+1,-1,-1,+1,+1...
Thread Forum Replies
trying to figure out a closed form formula General Math 9
Crazy Problem trying to figure out what formula is used for Introductory Physics Homework 1
trying to figure out how to solve a formula for the energy of light Introductory Physics Homework 1
Can Anybody Figure Out the Formula? Introductory Physics Homework 1