sin 1 + sin 3 + sin 5 + sin 7 + sin 9 + ...
Any ideas? PD: The angle is in radians.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 165 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Name |
---|
If you have no clue about a summation, Wolfram Alpha will save your butt. Link
Apperently a closed formular for the first
n + 1
elements is:sin(n+1)^2/sin(1)
. I guess you can prove this formular using induction and a few trigonometrical identities.sin α = Re(eiα)
Lol, I have written my previous post 4 days ago, got 22 upvotes and nobody pointed out, that there should be Im instead of Re :P. Btw even given that equality, I still don't know how to compute that sum : D.
You have a sum of geometric progression inside Im, you may calculate its sum in O(1) as some fraction and explicitly express its imaginary part by carefully dividing numerator by the denominator.
OK, that geometric progression is what I had in my mind when I was writing first post, but somehow I got stuck when computing imaginary part of [tex_crapped_on_cf]\frac{e^{(2n+1)i} — e^i}{e^{2i} — 1}[\tex_crapped_on_cf], but of course it can be done.
It is good idea to multiply this by or (because, for example, and there will be a lot of summands that "kill" each other, it is general way to simplify such sums) to get telescopic series, let's multiply (for example, , it works better in this case):
So, .