10

Numerical results for $m=1$ to $2000$ showed that the series

$$Q(m)=\sum_{n=1}^m (-1)^n \frac{\cos(\ln(n))}{\sqrt{n}}$$

converged to $-0.63986...$

Does the series

$$\sum_{n=1}^{\infty} (-1)^n \frac{\cos(\ln(n))}{\sqrt{n}}$$

converge?

here is plot of $Q(m)$ vs. $m$

Asaf Karagila
  • 393,674
mike
  • 5,604
  • 4
    $\large\tt -0.639861913937\ldots$. – Felix Marin Sep 19 '14 at 06:19
  • @FelixMarin. Thanks for the correction. How many terms did you use? – mike Sep 19 '14 at 06:57
  • 2
    I did't with Mathematica $$ \verbNSum[(-1)^n Cos[Log[n]]/Sqrt[n], {n, 1, Infinity}, WorkingPrecision -> 25] $$ – Felix Marin Sep 19 '14 at 07:09
  • 1
    The body of the question has square roots but the title does not. Which is intended? Without square roots, a variation of the AST for slowly rotating complex numbers can be applied. In fact if the denominator is $n^{a}$ with $a>1/2$, convergence is relatively easy to show. – 2'5 9'2 Sep 19 '14 at 07:16
  • @alex.jordan I just fixed it. Thanks! – mike Sep 19 '14 at 07:18
  • 2
    A clean proof will probably use the fact that this is the real part of $ \sum(-1)^n\frac{\cos(\ln(n))+i\sin(\ln(n))}{\sqrt{n}}=\sum(-1)^n\frac{\exp(i\ln(n))}{\sqrt{n}} $ – 2'5 9'2 Sep 19 '14 at 07:20
  • @ajex.jordan Thanks for the suggestion! – mike Sep 19 '14 at 07:34
  • 1
    @FelixMarin: I used the Euler-Maclaurin Sum Formula to compute this sum. I think Mathematica uses this formula, too. – robjohn Sep 19 '14 at 11:52
  • 1
    @alex.jordan: I just noticed that in this answer, I showed that the series for $\eta(s)$ converges for $\mathrm{Re}(s)\gt0$ and the series here is the series for $\mathrm{Re}(\eta(1/2-i))$. – robjohn Sep 19 '14 at 18:27

2 Answers2

12

Convergence

The Euler Maclaurin Sum Formula says that, for some constants $C$ and $S$, $$ \sum_{k=1}^n\frac{\cos(\log(k))}{\sqrt{k}} =\sqrt{n}\left[\frac25\cos(\log(n))+\frac45\sin(\log(n))\right]+C+O\left(n^{-1/2}\right)\tag{1} $$ and $$ \sum_{k=1}^n\frac{\sin(\log(k))}{\sqrt{k}} =\sqrt{n}\left[\frac25\sin(\log(n))-\frac45\cos(\log(n))\right]+S+O\left(n^{-1/2}\right)\tag{2} $$ Writing the alternating sum as the difference of twice the even terms minus all the terms, we get $$ \begin{align} &\sum_{k=1}^{2n}(-1)^k\frac{\cos(\log(k))}{\sqrt{k}}\\ &=2\sum_{k=1}^n\frac{\cos(\log(2k))}{\sqrt{2k}} -\sum_{k=1}^{2n}\frac{\cos(\log(k))}{\sqrt{k}}\\ &=\sqrt2\sum_{k=1}^n\frac{\cos(\log(2)+\log(k))}{\sqrt{k}} -\sum_{k=1}^{2n}\frac{\cos(\log(k))}{\sqrt{k}}\\ &=\sqrt2\cos(\log(2))\sum_{k=1}^n\frac{\cos(\log(k))}{\sqrt{k}}\\ &-\sqrt2\sin(\log(2))\sum_{k=1}^n\frac{\sin(\log(k))}{\sqrt{k}} -\sum_{k=1}^{2n}\frac{\cos(\log(k))}{\sqrt{k}}\\ &=\sqrt2\cos(\log(2))\sqrt{n}\left[\frac25\cos(\log(n))+\frac45\sin(\log(n))\right]\\ &-\sqrt2\sin(\log(2))\sqrt{n}\left[\frac25\sin(\log(n))-\frac45\cos(\log(n))\right]\\ &-\sqrt{2n}\left[\frac25\cos(\log(2n))+\frac45\sin(\log(2n))\right]\\ &+\left[\vphantom{\frac25}\sqrt2\cos(\log(2))-1\right]C-\sqrt2\sin(\log(2))\,S+O\left(n^{-1/2}\right)\\[6pt] &=\left[\vphantom{\frac25}\sqrt2\cos(\log(2))-1\right]C-\sqrt2\sin(\log(2))\,S+O\left(n^{-1/2}\right)\tag{3} \end{align} $$ Thus, the series converges to $$ \left[\vphantom{\frac25}\sqrt2\cos(\log(2))-1\right]C-\sqrt2\sin(\log(2))\,S\tag{4} $$


Computing the Sum

Using the Euler-Maclaurin Sum Formula to compute $C$ and $S$, we get $$ C=0.1439364270771890603243896664837216\tag{5} $$ and $$ S=0.7220997435316730891261751345803249\tag{6} $$ Therefore, using $(4)$, we get $$ \sum_{k=1}^\infty(-1)^k\frac{\cos(\log(k))}{\sqrt{k}}=-0.6398619139367474311364313137759324\tag{7} $$


The Asymptotic Expansions

Including more terms of the Euler-Maclaurin Sum Formula, we have $$ \sum_{k=1}^n\frac{\cos(\log(k))}{\sqrt{k}} =\sqrt{n}\left[a_s(n)\cos(\log(n))+a_c(n)\sin(\log(n))\vphantom{\tfrac25}\right]+C\tag{8} $$ and $$ \sum_{k=1}^n\frac{\sin(\log(k))}{\sqrt{k}} =\sqrt{n}\left[a_s(n)\sin(\log(n))-a_c(n)\cos(\log(n))\vphantom{\tfrac25}\right]+S\tag{9} $$ where $$ \begin{align} \hspace{-1cm}\small a_s(n)\,&\small=\frac25+\frac1{2n}-\frac1{24n^2}-\frac7{1920n^4}+\frac{491}{193536n^6}-\frac{11903}{4423680n^8}+\frac{822169}{181665792n^{10}}+O\left(\frac1{n^{12}}\right)\tag{10}\\[4pt] \hspace{-1cm}\small a_c(n)\,&\small=\frac45-\frac1{12n^2}+\frac{19}{2880n^4}-\frac{157}{96768n^6}+\frac{10039}{15482880n^8}+\frac{146483}{2452488192n^{10}}+O\left(\frac1{n^{12}}\right)\tag{11} \end{align} $$ $(8)-(11)$ were used with $n=1000$ to compute $(5)$ and $(6)$ to over $34$ places of precision.

Note that $(1)$ and $(2)$ are just truncated versions of $(8)-(11)$.


Zeta Function

As achille hui has noted in a comment, we have $$ \begin{align} \sum_{k=1}^\infty(-1)^k\frac{\cos(\log(k))}{\sqrt{k}} &=\mathrm{Re}\left[\sum_{k=1}^\infty(-1)^ke^{i\log(k)}k^{-1/2}\right]\\ &=\mathrm{Re}\left[\sum_{k=1}^\infty(-1)^kk^{-1/2+i}\right]\\ &=-\mathrm{Re}\left[\eta\left(1/2-i\right)\vphantom{\tfrac12}\right]\\[6pt] &=\mathrm{Re}\left[\left(2^{1/2+i}-1\right)\zeta\left(1/2-i\right)\right] \end{align} $$ This is probably why appears in the tags for this question.

In this answer, it is shown that the series for $\eta(s)$ converges for $\mathrm{Re}(s)\gt0$. So that answer offers another method to show that the sum in this question converges.

robjohn
  • 345,667
  • Very nice! This reminds me I need to have a look at this formula, I know it's useful to compute sums in extended precision, but I have never taken the time to dig further into it. – Jean-Claude Arbaut Sep 19 '14 at 11:31
  • @robjohn wonderful result!. Thanks! – mike Sep 19 '14 at 12:51
  • @Jean-ClaudeArbaut: I have added more of the detail of what I did with the Euler-Maclaurin Sum Formula. – robjohn Sep 19 '14 at 15:46
  • 2
    Numerically, it is the same as $$-\Re\left[\left(1-2^{1/2+i}\right)\zeta\left(\frac12-i\right)\right]\ \approx -0.63986191393674743113643131377593235163275874915340904848016...$$ (number from WA) – achille hui Sep 19 '14 at 15:56
  • 1
    @achillehui: as well it should, since they are the same. I noticed this, but didn't include it. Perhaps I should. – robjohn Sep 19 '14 at 16:01
  • @achillehui. Yes, I am aware that it is $-\Re \eta(-i+1/2)$. This is the reason I added "Riemann Zeta" tag, as robjohn guessed. But I am not aware of robjohn's answer in another solution when I posted the question. Thanks! – mike Sep 19 '14 at 19:16
  • @robjohn: I need to find the asymptotic expansion for $\sum_{k=1}^{n} (-1)^n \frac{\cos(x\ln(k))}{\sqrt{k}},x>0$. I am planning to use your method to do it. What form of Euler-MacLaurin sum formula do you use to derive equations (8)-(11)? – mike Dec 16 '14 at 13:21
  • @robjohn: Did you use this one? $\sum_{i=m+1}^n f(i)=\int_m^{n}f(x)dx+B_1(f(n)-f(m))+\sum_{k=1}^p\frac{B_{2k}}{(2k)!}\left(f^{(2k-1)}(n)-f^{(2k-1)}(m)\right)+R$. thanks – mike Dec 16 '14 at 13:29
  • @mike: that is as good as any form. The terms for the lower limit (those with $m$) are usually collected into a single constant. – robjohn Dec 16 '14 at 13:41
  • @robjohn: Thanks for the quick answer! I used mathematica 9.0 and implemented the expression above. When I set $m=1,p=5$, I got identical expression like (8)-(11) except that the term $+\frac{1}{2n}$ in (10). I got $\color{red}{-}\frac{1}{2n}$. Could you please check if there is a typo in (10)? – mike Dec 16 '14 at 13:54
  • @mike: I have checked. The computation of the the asymptotic expansion was done using a Mathematica program that I wrote a long time ago and which has proven to be accurate. Have you checked numerically? – robjohn Dec 16 '14 at 14:44
  • Hi Rob. How does one know apriori that the constants $C$ and $S$ remain bounded as one takes more and more terms in the EMSF? It seems that you're making that assertion without providing support for its validity. Did you simply inspect the remainder term to ascertain this? -Mark – Mark Viola Aug 20 '16 at 05:46
  • @Dr.MV: If we have the approximations $(1)$ and $(2)$, any further terms are of the order $O\left(n^{-1/2}\right)$; that is, they decrease as $n\to\infty$. Thus, adding further terms will not affect the constant term. – robjohn Aug 20 '16 at 18:25
  • Rob, thank you for replying. But the constants are determined in the EMSF as an infinite series, the terms of which arise from evaluating the function $\frac{\cos(\log(x))}{\sqrt{x}}$ and its odd-ordered derivatives at $x=1$. We know that the partial sums of the series that generates the constants $C$ and $S$ are bounded by inspecting the remainder of the EMSF (I mentioned this in my initial comment and I believe you are corroborating this in your reply). Does it not take more work to show that in fact, that the series that generates $C$ and $S$ converges? -Mark – Mark Viola Aug 20 '16 at 19:04
  • @Dr.MV: You might be referring to the formula $$ \begin{align} &\sum_{k=1}^nf(k)-\int_0^nf(x),\mathrm{d}x\ &=\sum_{k=0}^{m-1}B_{k+1}(1)(f^{(k)}(n)-f^{(k)}(0))\ &+\sum_{k=1}^n\int_0^1B_m(x)(f^{(m)}(k)-f^{(m)}(k-x)),\mathrm{d}x\tag{$\ast$} \end{align} $$ In any case, $C$ and $S$ are constants. Their representation as a sum of derivatives in $(\ast)$ usually does not converge since the series derived from the Euler-Maclaurin Sum Formula does not converge. – robjohn Aug 20 '16 at 23:12
  • In this answer, it is shown that if the Fourier Transform of the function is supported in the interval $[-1,1]$, then the series from the Euler-Maclaurin Sum Formula converges, but in general, the series diverges. The Euler-Maclaurin Sum Formula only gives an asymptotic approximation. However, given the asymptotic formulas in $(1)$ and $(2)$, one can compute the constants by computing the finite sums and subtracting the formulas on the right. The error decreases as $n^{-1/2}$. – robjohn Aug 20 '16 at 23:12
  • Rob, yes I realize all of this. So, we have $$C_n=\text{LHS}-\sqrt{n}\left(\text{terms on RHS}\right)+O(n^{-1/2})$$which still requires our showing that the difference of $\text{LHS}-\sqrt{n}\left(\text{terms on RHS}\right)$ converges. If it does, then $C_n$ does, and vice versa. So, which one has been shown to converge? – Mark Viola Aug 20 '16 at 23:28
  • Other formulations of the EMSF are easier to use in practice. The fact that $C$ and $S$ are constants is a main point of the EMSF. While not proving the EMSF here, I will note that in this case, the binomial theorem gives $$ \begin{align} \frac{k^{i+1/2}-(k-1)^{i+1/2}}{i+1/2} &=\frac{k^{i+1/2}}{i+1/2}\left(1-\left(1-\frac1k\right)^{i+1/2}\right)\ &=\frac{k^{i+1/2}}{i+1/2}\left(\frac{i+1/2}k+O!\left(\frac1{k^2}\right)\right)\ &=k^{i-1/2}+O!\left(k^{i-3/2}\right)\tag{$\ast\ast$} \end{align} $$ Summing $(\ast\ast)$ in $k$ and separating real and imaginary parts gives $(1)$ and $(2)$. – robjohn Aug 21 '16 at 12:23
4

We multiply the original series by $(-1)$ and obtain

$$-Q(m)=\sum_{n=1}^{\infty} (-1)^{n+1} \frac{\cos(\ln(n))}{\sqrt{n}}=\sum_{k=0}^{\infty} a_k\tag{0}$$ with$$a_k=\frac{\cos(\ln(2k+1))}{\sqrt{2k+1}}-\frac{\cos(\ln(2k+2))}{\sqrt{2k+2}}\tag{1}$$

Set $2k+1=m$. Then, when $m\to\infty$,

$$\ln(m+1)=\ln m +m^{-1}+O(m^{-2}). \tag{2}$$

Substituting (2) into (1) and expanding the result as a series in $m^{-1/2}$ leads to

$$a_k=m^{-3/2}\left(\frac{1}{2}\cos(\ln m)+\sin(\ln m)\right)+O(m^{-5/2}).\qquad m\to\infty \tag{3}$$

So $$|a_k|\le m^{-3/2}\left(\frac{1}{2}|\cos(\ln m)|+|\sin(\ln m)|\right)+O(m^{-5/2})=O(m^{-3/2})=O(k^{-3/2})\tag{4}$$

Therefore the original series in (0) is convergent.

mike
  • 5,604
  • 2
    The idea is good but the inequality signs at the end are too strong (there are $O(m^{-5/2})$ error terms). – Did Sep 19 '14 at 05:56
  • @Did Thanks a lot for the guidance! – mike Sep 19 '14 at 06:48
  • 1
    There was still an incorrect inequality, I took on me to add the relevant error terms. – Did Sep 19 '14 at 08:43
  • @Did. Thanks for the editing. Please feel free to do it because I am not familiar with this kind of things. – mike Sep 19 '14 at 08:50
  • 1
    You are welcome. The answer looks fine now and, as I said, your idea to solve this was a good one. +1. – Did Sep 19 '14 at 08:51