Line 96:
Line 96:
The cotangent expansion is {{OEIS2C|A081785}}
The cotangent expansion is {{OEIS2C|A081785}}
:<math> \log 2 = \cot (\arccot 0 -\arccot 1 +\arccot 5 -\arccot 55 +\arccot 14187 -\ldots) </math>.
:<math> \log 2 = \cot (\arccot 0 -\arccot 1 +\arccot 5 -\arccot 55 +\arccot 14187 -\ldots) </math>.
As an infinite sum of fractions<ref>"The Penguin's Dictionary of Curious and Interesting Numbers" by David Wells, page 29.</ref>:
:<math> \log 2 = \frac{1}{1} -\frac{1}{2} +\frac{1}{3} -\frac{1}{4} +\frac{1}{5} -\ldots </math>.
These [[generalized continued fraction]]s:
These [[generalized continued fraction]]s:
:<math> \log 2 = \log (1+1) = \cfrac{2} {2+\cfrac{1} {1+\cfrac{1} {6+\cfrac{2} {1+\cfrac{2} {10+\cfrac{3} {1+\cfrac{3} {14+\cfrac{4} {1+\ddots}}}}}}}}
:<math> \log 2 = \log (1+1) = \cfrac{2} {2+\cfrac{1} {1+\cfrac{1} {6+\cfrac{2} {1+\cfrac{2} {10+\cfrac{3} {1+\cfrac{3} {14+\cfrac{4} {1+\ddots}}}}}}}}
The decimal value of the natural logarithm of 2 (sequence A002162 in the OEIS )
is approximately
ln
2
≈
0.693147
{\displaystyle \ln 2\approx 0.693147}
as shown in the first line of the table below.
The logarithm in other bases is obtained with the formula
log
b
2
=
ln
2
ln
b
.
{\displaystyle \log _{b}2={\frac {\ln 2}{\ln b}}.}
The common logarithm in particular is (OEIS : A007524 )
log
10
2
≈
0.301029995663981195
{\displaystyle \log _{10}2\approx 0.301029995663981195}
.
The inverse of this number is the binary logarithm of 10:
log
2
10
=
1
/
log
10
2
≈
3.321928095
{\displaystyle \log _{2}10=1/\log _{10}2\approx 3.321928095}
(OEIS : A020862 ).
class="wikitable "
Series representations
∑
n
=
1
∞
(
−
1
)
n
+
1
n
=
∑
n
=
0
∞
1
(
2
n
+
1
)
(
2
n
+
2
)
=
ln
2.
{\displaystyle \sum _{n=1}^{\infty }{\frac {(-1)^{n+1}}{n}}=\sum _{n=0}^{\infty }{\frac {1}{(2n+1)(2n+2)}}=\ln 2.}
∑
n
=
1
∞
(
−
1
)
n
(
n
+
1
)
(
n
+
2
)
=
2
ln
2
−
1.
{\displaystyle \sum _{n=1}^{\infty }{\frac {(-1)^{n}}{(n+1)(n+2)}}=2\ln 2-1.}
∑
n
=
1
∞
1
n
(
4
n
2
−
1
)
=
2
ln
2
−
1.
{\displaystyle \sum _{n=1}^{\infty }{\frac {1}{n(4n^{2}-1)}}=2\ln 2-1.}
∑
n
=
1
∞
(
−
1
)
n
n
(
4
n
2
−
1
)
=
ln
2
−
1.
{\displaystyle \sum _{n=1}^{\infty }{\frac {(-1)^{n}}{n(4n^{2}-1)}}=\ln 2-1.}
∑
n
=
1
∞
(
−
1
)
n
n
(
9
n
2
−
1
)
=
2
ln
2
−
3
2
.
{\displaystyle \sum _{n=1}^{\infty }{\frac {(-1)^{n}}{n(9n^{2}-1)}}=2\ln 2-{\frac {3}{2}}.}
∑
n
=
2
∞
1
2
n
[
ζ
(
n
)
−
1
]
=
ln
2
−
1
2
.
{\displaystyle \sum _{n=2}^{\infty }{\frac {1}{2^{n}}}[\zeta (n)-1]=\ln 2-{\frac {1}{2}}.}
∑
n
=
1
∞
1
2
n
+
1
[
ζ
(
n
)
−
1
]
=
1
−
γ
−
1
2
ln
2.
{\displaystyle \sum _{n=1}^{\infty }{\frac {1}{2n+1}}[\zeta (n)-1]=1-\gamma -{\frac {1}{2}}\ln 2.}
∑
n
=
1
∞
1
2
2
n
(
2
n
+
1
)
ζ
(
2
n
)
=
1
2
(
1
−
ln
2
)
.
{\displaystyle \sum _{n=1}^{\infty }{\frac {1}{2^{2n}(2n+1)}}\zeta (2n)={\frac {1}{2}}(1-\ln 2).}
ln
2
=
∑
k
≥
1
1
k
2
k
.
{\displaystyle \ln 2=\sum _{k\geq 1}{\frac {1}{k2^{k}}}.}
ln
2
=
∑
k
≥
1
(
1
3
k
+
1
4
k
)
1
k
.
{\displaystyle \ln 2=\sum _{k\geq 1}({\frac {1}{3^{k}}}+{\frac {1}{4^{k}}}){\frac {1}{k}}.}
ln
2
=
2
3
+
∑
k
≥
1
(
1
2
k
+
1
4
k
+
1
+
1
8
k
+
4
+
1
16
k
+
12
)
1
16
k
.
{\displaystyle \ln 2={\frac {2}{3}}+\sum _{k\geq 1}({\frac {1}{2k}}+{\frac {1}{4k+1}}+{\frac {1}{8k+4}}+{\frac {1}{16k+12}}){\frac {1}{16^{k}}}.}
ln
2
=
2
3
∑
k
≥
0
1
(
2
k
+
1
)
9
k
.
{\displaystyle \ln 2={\frac {2}{3}}\sum _{k\geq 0}{\frac {1}{(2k+1)9^{k}}}.}
(
γ
{\displaystyle \gamma }
is the Euler-Mascheroni constant
and
ζ
{\displaystyle \zeta }
Riemann's zeta function ).
Some BBP type representations fall also into this category.
Representation as integrals
∫
0
1
d
x
1
+
x
=
ln
2.
{\displaystyle \int _{0}^{1}{\frac {dx}{1+x}}=\ln 2.}
∫
1
∞
d
x
(
1
+
x
2
)
(
1
+
x
)
2
=
1
4
(
1
−
ln
2
)
.
{\displaystyle \int _{1}^{\infty }{\frac {dx}{(1+x^{2})(1+x)^{2}}}={\frac {1}{4}}(1-\ln 2).}
∫
0
∞
d
x
1
+
e
n
x
=
1
n
ln
2
;
∫
0
∞
d
x
3
+
e
n
x
=
2
3
n
ln
2.
{\displaystyle \int _{0}^{\infty }{\frac {dx}{1+e^{nx}}}={\frac {1}{n}}\ln 2;\int _{0}^{\infty }{\frac {dx}{3+e^{nx}}}={\frac {2}{3n}}\ln 2.}
∫
0
∞
[
1
e
x
−
1
−
2
e
2
x
−
1
]
=
ln
2.
{\displaystyle \int _{0}^{\infty }[{\frac {1}{e^{x}-1}}-{\frac {2}{e^{2x}-1}}]=\ln 2.}
∫
0
∞
e
−
x
1
−
e
−
x
x
d
x
=
ln
2.
{\displaystyle \int _{0}^{\infty }e^{-x}{\frac {1-e^{-x}}{x}}dx=\ln 2.}
∫
0
1
ln
x
2
−
1
x
ln
x
d
x
=
−
1
+
ln
2
+
γ
.
{\displaystyle \int _{0}^{1}\ln {\frac {x^{2}-1}{x\ln x}}dx=-1+\ln 2+\gamma .}
∫
0
π
/
3
tan
x
d
x
=
2
∫
0
π
/
4
tan
x
d
x
=
ln
2.
{\displaystyle \int _{0}^{\pi /3}\tan xdx=2\int _{0}^{\pi /4}\tan xdx=\ln 2.}
∫
−
π
/
4
π
/
4
ln
(
sin
x
+
cos
x
)
d
x
=
−
π
4
ln
2.
{\displaystyle \int _{-\pi /4}^{\pi /4}\ln(\sin x+\cos x)dx=-{\frac {\pi }{4}}\ln 2.}
∫
0
1
x
2
ln
(
1
+
x
)
d
x
=
2
3
ln
2
−
5
18
.
{\displaystyle \int _{0}^{1}x^{2}\ln(1+x)dx={\frac {2}{3}}\ln 2-{\frac {5}{18}}.}
∫
0
1
x
ln
(
1
+
x
)
ln
(
1
−
x
)
d
x
=
1
4
−
ln
2.
{\displaystyle \int _{0}^{1}x\ln(1+x)\ln(1-x)dx={\frac {1}{4}}-\ln 2.}
∫
0
1
x
3
ln
(
1
+
x
)
ln
(
1
−
x
)
d
x
=
13
96
−
2
3
ln
2.
{\displaystyle \int _{0}^{1}x^{3}\ln(1+x)\ln(1-x)dx={\frac {13}{96}}-{\frac {2}{3}}\ln 2.}
∫
0
1
ln
x
(
1
+
x
)
2
d
x
=
−
ln
2.
{\displaystyle \int _{0}^{1}{\frac {\ln x}{(1+x)^{2}}}dx=-\ln 2.}
∫
0
1
ln
(
1
+
x
)
−
x
x
2
d
x
=
1
−
2
ln
2.
{\displaystyle \int _{0}^{1}{\frac {\ln(1+x)-x}{x^{2}}}dx=1-2\ln 2.}
∫
0
1
d
x
x
(
1
−
ln
x
)
(
1
−
2
ln
x
)
=
ln
2.
{\displaystyle \int _{0}^{1}{\frac {dx}{x(1-\ln x)(1-2\ln x)}}=\ln 2.}
∫
1
∞
ln
ln
x
x
3
d
x
=
−
1
2
(
γ
+
ln
2
)
.
{\displaystyle \int _{1}^{\infty }{\frac {\ln \ln x}{x^{3}}}dx=-{\frac {1}{2}}(\gamma +\ln 2).}
(
γ
{\displaystyle \gamma }
is the Euler-Mascheroni constant ).
Other representations
The Pierce expansion is OEIS : A091846
log
2
=
1
1
−
1
1
⋅
3
+
1
1
⋅
3
⋅
12
−
…
{\displaystyle \log 2={\frac {1}{1}}-{\frac {1}{1\cdot 3}}+{\frac {1}{1\cdot 3\cdot 12}}-\ldots }
.
The Engel expansion is OEIS : A059180
log
2
=
1
2
+
1
2
⋅
3
+
1
2
⋅
3
⋅
7
+
1
2
⋅
3
⋅
7
⋅
9
+
…
{\displaystyle \log 2={\frac {1}{2}}+{\frac {1}{2\cdot 3}}+{\frac {1}{2\cdot 3\cdot 7}}+{\frac {1}{2\cdot 3\cdot 7\cdot 9}}+\ldots }
.
The cotangent expansion is OEIS : A081785
log
2
=
cot
(
arccot
0
−
arccot
1
+
arccot
5
−
arccot
55
+
arccot
14187
−
…
)
{\displaystyle \log 2=\cot(\operatorname {arccot} 0-\operatorname {arccot} 1+\operatorname {arccot} 5-\operatorname {arccot} 55+\operatorname {arccot} 14187-\ldots )}
.
As an infinite sum of fractions[1] :
log
2
=
1
1
−
1
2
+
1
3
−
1
4
+
1
5
−
…
{\displaystyle \log 2={\frac {1}{1}}-{\frac {1}{2}}+{\frac {1}{3}}-{\frac {1}{4}}+{\frac {1}{5}}-\ldots }
.
These generalized continued fractions :
log
2
=
log
(
1
+
1
)
=
2
2
+
1
1
+
1
6
+
2
1
+
2
10
+
3
1
+
3
14
+
4
1
+
⋱
=
2
3
−
1
9
−
4
15
−
9
21
−
16
27
−
⋱
{\displaystyle \log 2=\log(1+1)={\cfrac {2}{2+{\cfrac {1}{1+{\cfrac {1}{6+{\cfrac {2}{1+{\cfrac {2}{10+{\cfrac {3}{1+{\cfrac {3}{14+{\cfrac {4}{1+\ddots }}}}}}}}}}}}}}}}={\cfrac {2}{3-{\cfrac {1}{9-{\cfrac {4}{15-{\cfrac {9}{21-{\cfrac {16}{27-\ddots }}}}}}}}}}}
Bootstrapping other logarithms
Given a value of
ln
2
{\displaystyle \ln 2}
, a scheme of computing the
logarithms of other integers is to tabulate the logarithms of the
prime numbers and in the next layer the logarithms of the composite
numbers
c
{\displaystyle c}
based on their factorizations
c
=
2
i
3
j
5
k
7
l
⋯
→
ln
c
=
i
ln
2
+
j
ln
3
+
k
ln
5
+
l
ln
7
+
⋯
{\displaystyle c=2^{i}3^{j}5^{k}7^{l}\cdots \rightarrow \ln c=i\ln 2+j\ln 3+k\ln 5+l\ln 7+\cdots }
Apart from the logarithms of 2, 3, 5 and 7 shown above, this employs
class="wikitable "
In a third layer, the logarithms of rational numbers
r
=
a
/
b
{\displaystyle r=a/b}
are computed with
ln
r
=
ln
a
−
ln
b
{\displaystyle \ln r=\ln a-\ln b}
, and logarithms of roots
via
ln
c
n
=
1
n
ln
c
{\displaystyle \ln {\sqrt[{n}]{c}}={\frac {1}{n}}\ln c}
.
The logarithm of 2 is useful in the sense that the powers
of 2 are rather densely distributed; finding powers
2
i
{\displaystyle 2^{i}}
close to powers
b
j
{\displaystyle b^{j}}
of other numbers
b
{\displaystyle b}
is
comparatively easy, and series representations of
ln
b
{\displaystyle \ln b}
are found by coupling
2
{\displaystyle 2}
to
b
{\displaystyle b}
with logarithmic conversions .
Example
If
p
s
=
q
t
+
d
{\displaystyle p^{s}=q^{t}+d}
with some small
d
{\displaystyle d}
,
then
p
s
/
q
t
=
1
+
d
/
q
t
{\displaystyle p^{s}/q^{t}=1+d/q^{t}}
and therefore
s
ln
p
−
t
ln
q
=
ln
(
1
+
d
q
t
)
=
∑
m
=
1
∞
(
−
1
)
m
+
1
(
d
/
q
t
)
m
m
{\displaystyle s\ln p-t\ln q=\ln(1+{\frac {d}{q^{t}}})=\sum _{m=1}^{\infty }(-1)^{m+1}{\frac {(d/q^{t})^{m}}{m}}}
.
Selecting
q
=
2
{\displaystyle q=2}
represents
ln
p
{\displaystyle \ln p}
by
ln
2
{\displaystyle \ln 2}
and a series of
a parameter
d
/
q
t
{\displaystyle d/q^{t}}
that one wishes to keep small for quick convergence. Taking
3
2
=
2
3
+
1
{\displaystyle 3^{2}=2^{3}+1}
, for example, generates
2
ln
3
=
3
ln
2
−
∑
k
≥
1
(
−
1
)
k
k
8
k
.
{\displaystyle 2\ln 3=3\ln 2-\sum _{k\geq 1}{\frac {(-1)^{k}}{k8^{k}}}.}
This is actually the third line in the following table of
expansions of this type:
class="wikitable "
Starting from the natural logarithm of
q
=
10
{\displaystyle q=10}
one might use these parameters:
class="wikitable "
Natural logarithm of 10
The natural logarithm of 10 (OEIS : A002392 )
plays a role for example in computation of
natural logarithms of numbers represented in the Scientific notation ,
a mantissa mutliplied by a power of 10:
ln
(
a
×
10
n
)
=
ln
a
+
n
ln
10.
{\displaystyle \ln(a\times 10^{n})=\ln a+n\ln 10.}
By this scaling, the algorithm may reduce the
logarithm of all positive real numbers to an algorithm for natural logarithms
in the range
1
≤
a
<
10
{\displaystyle 1\leq a<10}
.
References
Brent, Richard P. (1976). "Fast multiple-precision evaluation of elementary functions". J. ACM . 23 (2): 242–251. doi :10.1145/321941.321944 . MR 0395314 .
Uhler, Horace S. (1940). "Recalculation and extension of the modulus and of the logarithms of 2, 3, 5, 7 and 17". Proc. Nat. Acac. Sci. U. S. A . 26 : 205–212. MR 0001523 .
Sweeney, Dura W. (1963). "On the computation of Euler's constant". Mathematics of Computation . 17 . MR 0160308 .
Chamberland, Marc (2003). "Binary BBP-formulae for logarithms and generalized Gaussian-Mersenne primes" (PDF) . Journal of Integer Sequences . 6 : 03.3.7. MR 2046407 .
Gourévitch, Boris; Guillera Goyanes, Jesus (2007). "Construction of binomial sums for π and polylogarithmic constants inspired by BBP formulas" (PDF) . Applied Math. E-Notes . 7 : 237–246. MR 2346048 . {{cite journal }}
: CS1 maint: multiple names: authors list (link )
Wu, Qiang (2003). "On the linear independence measure of logarithms of rational numbers". Mathematics of Computation . 72 (242): 901–911. doi :10.1090/S0025-5718-02-01442-4 .
External links
^ "The Penguin's Dictionary of Curious and Interesting Numbers" by David Wells, page 29.