Euler discovered and proved that ∑n−2 = π2/6.
(Modern derivation)
This is a slowly converging series and the discovery probably required several digits.
The naïve calculation merely omits the tail of the series after n terms, but that tail sums to about 1/n which is a big error for tolerable n.
Here is how to get a very good estimate of the sum of the tail and thus reduce the error to about 1/(last term)3.
Euler certainly knew of this.
It has to do with approximating n−2 with In = integral of x−2 from n−1/2 to n+1/2.
In = 1/(n − 1/2) − 1/(n + 1/2) = 1/(n2 − 1/4)
= n−2/(1 − 1/(4n2))
= n−2∑k≥0(4n2)−k
= n−2 + n−2∑k≥1(4n2)−k.
In − n−2 ≃ n−4/4.
∑n≥101 (In − n−2)
≃ ∑n≥101 n−4/4
≃ 101−3/4.
∑n≥101 (In − n−2) =
∑n≥101 In − ∑n≥101 n−2
≃ 101−3/4.
but ∑n≥101 In = (Integral x−2 from x=100.5 to ∞) = 1/100.5 .
#include <stdio.h>
static double sq(double x){return x*x;}
int main(){int i=0; double s = 0;
double pi = 3.141592653589793238;
while(i < 100) {++i; s += sq(1./i);}
s += 1/(i+0.5);
{double p2 = sq(pi), p2o6 = p2/6;
printf("%19.16f %19.16f %19.16f %e\n",
p2, p2o6, s, p2o6-s);}
return 0;}
This program yields:
9.8696044010893580 1.6449340668482264 1.6449341489411111 -8.209288e-08.
Now I need to evaluate ∑ln(n)n−2 and Dwight gives Integral ln(x)/x2 =
−ln(x)/x − 1/x.
Now letting In = integral of ln(x)x−2 from n−1/2 to n+1/2, Mutatis Mutandis (html):
It has to do with approximating ln(n)n−2 with In = integral of ln(x)x−2 from n−1/2 to n+1/2.
In = ln(n − 1/2)/(n − 1/2) − ln(n + 1/2)/(n + 1/2) ≃ ln(n)n−2 + O(n−4)
according to the next small program:
#include <stdio.h>
#include <math.h>
typedef double f;
static f sq(f x){return x*x;}
static f F(f x){return log(x)/sq(x);}
static f intg(f x){return -log(x)/x - 1/x;}
static f isn(f x){return intg(x + 0.5) - intg(x - 0.5);}
static f err(f x){return F(x) - isn(x);}
int main(){f x = 1;
while (x < 2000000) {printf("%e %e\n", x, err(x)); x *= 10.;}
return 0;}
In − ln(n)n−2 ≃ n−4
∑n≥101 (In − ln(n)n−2) ≃ 101−3
∑n≥101 (In − ln(n)n−2) =
∑n≥101 In − ∑n≥101 ln(n)n−2
≃ 101−3
but ∑n≥101 In = (Integral ln(x)x−2 from x=100.5 to ∞) =
−ln(100.5)/100.5 − 1/100.5 .
#include <stdio.h>
#include <math.h>
typedef double f;
static f sq(f x){return x*x;}
static f F(f x){return log(x)/sq(x);}
static f intg(f x){return -log(x)/x - 1/x;}
static void mx(int k){int i=0; double s = 0;
while(i < k) {++i; s += F(i);}
s -= intg(i+ 0.5);
printf("%19.16f %d\n", s, k);}
int main(){mx(10); mx(100); mx(1000);
mx(10000); mx(100000); mx(1000000);
return 0;}
This program yields:
0.9376812399594099 10
0.9375485917322104 100
0.9375482548490655 1000
0.9375482543165695 10000
0.9375482543158479 100000
0.9375482543158530 1000000
I conclude that indeed the error is about (last term)3/2
and that the answer to the original problem is:
∑ln(n)n−2 = 0.937548254315853
Perhaps this is ζ'(2).
For ζ(3) = ∑n−3
Integral of x−3 is −x−2/2
In = (1/(n−1/2)2 − 1/(n+1/2)2)/2
=
n−3 + n−5/2 + O(n−7)
#include <stdio.h>
#include <math.h>
typedef double f;
static f F(f x){return 1./(x*x*x);}
static f intg(f x){return -1./(2.*x*x);}
static void mx(int k){int i=0; double s = 0;
while(i < k) {++i; s += F(i);}
s += intg(i + 0.5);
printf("%19.16f %d\n", s, k);}
int main(){mx(10); mx(100); mx(1000);
mx(10000); mx(100000); mx(1000000);
return 0;}
yields
1.2020671330664836 10
1.2020569043848328 100
1.2020569031597192 1000
1.2020569031595945 10000
1.2020569031595945 100000
1.2020569031595942 1000000
ζ(3) = 1.202056903159594285399738161511449990764986292
This remarkable computation was invented in India by 1500 perhaps 1400, predating Euler.
typedef long double R;
#include
int main(){
int j=101; R o = 1, s=(j*j+1.)/(4.*j*j*j + 5.*j);
while(j--) {s = 1/o - s; o += 2;}
printf("%25.20Lf\n", 4.*s);
return 0;}
// 3.14159265358978799618
I know no way to derive this except thru calculus.