# How can I get a good estimation of the following function

The function is $$f(n) = \sum_{i=1}^{n} \frac{1}{2i-1}$$ How can I compute for example $f(20)$ or $f(50)$ without using a calculator. I want to have an approximation

-
are you allowed to use a table of log-values? – Alex May 24 '14 at 9:29
yeah, log values are ok – neticin May 24 '14 at 9:45
pls see the edit – Alex May 24 '14 at 9:57

It's a harmonic sum with odd terms: $$S_n = 1 + \frac{1}{3} + \ldots \frac{1}{2n-1} = 1 +\frac{1}{2}+\frac{1}{3} + \ldots \frac{1}{2n} - \frac{1}{2}-\frac{1}{4} -\ldots \frac{1}{2n} = H_{2n}-\frac{1}{2}H_n$$ and each $H_{k} \sim \log k +\gamma$.

EDIT: Since $H_{2n} \sim \log 2n + \gamma = \log 2 + \log n + \gamma$ this whole expression reduces to $\frac{1}{2} \log n +\log 2 +\frac{\gamma}{2}$

-

It is possible to show that $$f(n) = \sum_{i=1}^{n} \frac{1}{2i-1}=\frac{1}{2} \left(\psi ^{(0)}\left(n+\frac{1}{2}\right)-\psi ^{(0)}\left(\frac{1}{2}\right)\right)$$ where appears the polygamma function. For large values of $n$, you have as an approximation $$f(n) =\left(-\frac{1}{2} \log \left(\frac{1}{n}\right)-\frac{\psi ^{(0)}\left(\frac{1}{2}\right)}{2}\right)+O\left(\left(\frac{1}{n}\right)^2\right)$$ where $$\psi ^{(0)}\left(\frac{1}{2}\right) \simeq -1.96351$$ So $$f(n) \simeq \frac{1}{2} \log(n)+0.981755$$ will be a good approximation.

Let us try with you numbers : for $n=20$, the exact value is $2.479673210$ while the approxiamtion leads to $2.479621150$; for $n=50$, the corresponding values are $2.937774848$ and $2.937766516$.

-
how did you get digamma of 1/2 without a calculator or a table? – Alex May 24 '14 at 9:45
As far as I understood, the OP wanted an approximation. I did not think that he required that the approximation should not be built using a computer. By the way, I like your answer : +1 ! Cheers. – Claude Leibovici May 24 '14 at 9:48