Rational approximations to gamma
- From: Han de Bruijn <Han.deBruijn@xxxxxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 12:26:28 +0200
The Euler-Mascheroni constant 'gamma' is defined by:
gamma = lim_(N -> oo) [ sum_(k=1)^N 1/k - ln(N) ]
Substitute N = 2^m then:
gamma = lim_(m -> oo) [ sum_(k=1)^(2^m) 1/k - m.ln(2) ]
= lim_(m -> oo) [ sum_(k=1)^(2^(m+1)) 1/k - (m+1).ln(2) ]
= lim_(m -> oo) [ sum_(k=1)^(2^m) 1/k - m.ln(2)
+ sum_(k=2^m+1)^(2^(m+1)) 1/k - ln(2) ]
Consequently: ln(2) = lim_(m -> oo) [ sum_(k=2^m+1)^(2^(m+1)) 1/k ]
Substitute: gamma = lim_(m -> oo) [ sum_(k=1)^(2^m) 1/k
- m.sum_(k=2^m+1)^(2^(m+1)) 1/k ]
Giving the limit of a _rational_ expression for 'gamma'.
We can enclose ln(2) between an upper and a lower bound, by looking
at the integral defining ln(2) as int_1^2 dx/x :
sum_(k=2^m+1)^(2^(m+1)) 1/(2^m)/(k/(2^m)) < ln(2)
sum_(k=2^m)^(2^(m+1)-1) 1/(2^m)/(k/(2^m)) > ln(2)
Resulting in:
sum_(k=2^m+1)^(2^(m+1)) 1/k < ln(2) < sum_(k=2^m)^(2^(m+1)-1) 1/k
And with help of the article "Proof of a Theorem by R.M. Young"
http://groups.google.nl/group/sci.math/msg/54df0436354854f7
we also find rational bounds for 'gamma': L < gamma < R with
L := sum_(k=1)^(2^m) 1/k - m.sum_(k=2^m)^(2^(m+1)-1) 1/k - 1/(2(2^(m))
R := sum_(k=1)^(2^m) 1/k - m.sum_(k=2^m+1)^(2^(m+1)) 1/k - 1/(2(2^m+1))
When making calculations, the _bottleneck_ is in the harmonic series,
especially [ sum_(k=2^m+1)^(2^(m+1)) 1/k ] . Half of the work can be
saved by re-using the previous summation and summing only over the odd
values of (k). I wonder of more such SAVINGS can be made when summing
the harmonic series .. ?!
Here comes a relevant snippet of code. Any comments are quite welcome.
program logaritm;
const
gamma : double = 0.577215664901532860606512090082402431042;
function twee(n : integer) : integer;
{
2^n
}
begin
twee := 1 shl n;
end;
function half(a,b : integer) : double;
{
Half of the work: odd
part of harmonic series
}
var
k,p,q,m : integer;
s : double;
begin
half := 0;
if b-a < 1 then Exit;
s := 0;
p := (a-1) div 2;
q := b div 2;
for k := p to q-1 do
begin
m := 2*k+1;
s := s + 1/m;
end;
half := s;
end;
procedure test;
{
Just a test
}
var
M : integer;
som1,som2,som3,L,R : double;
begin
som1 := 0; som2 := 1;
for M := 0 to 29 do
begin
som1 := som1 + som2;
som2 := half(twee(M)+1,twee(M+1)) + som2/2;
som3 := som2 - 1/twee(M+1) + 1/twee(M);
Writeln(M,' ',som1 - ln(2)*M,' = ',gamma);
Writeln(som2,' < ',ln(2),' < ',som3);
L := som1 - som3*M - 1/(2*twee(M));
R := som1 - som2*M - 1/(2*(twee(M)+1));
Writeln(L,' < ',gamma,' < ',R);
end;
end;
begin
test;
end.
Snippet of output:
23 5.77215724506179E-0001 = 5.77215664901533E-0001
6.93147150757633E-0001 < 6.93147180559945E-0001 < 6.93147210362278E-0001
5.77214979447887E-0001 < 5.77215664901533E-0001 < 5.77216350354724E-0001
24 5.77215694703865E-0001 = 5.77215664901533E-0001
6.93147165658792E-0001 < 6.93147180559945E-0001 < 6.93147195461114E-0001
5.77215307273491E-0001 < 5.77215664901533E-0001 < 5.77216022529230E-0001
25 5.77215679802713E-0001 = 5.77215664901533E-0001
6.93147173109328E-0001 < 6.93147180559945E-0001 < 6.93147188010490E-0001
5.77215478637945E-0001 < 5.77215664901533E-0001 < 5.77215851166975E-0001
26 5.77215672352095E-0001 = 5.77215664901533E-0001
6.93147176834559E-0001 < 6.93147180559945E-0001 < 6.93147184285140E-0001
5.77215568046453E-0001 < 5.77215664901533E-0001 < 5.77215761761548E-0001
27 5.77215668626711E-0001 = 5.77215664901533E-0001
6.93147178697210E-0001 < 6.93147180559945E-0001 < 6.93147182422500E-0001
5.77215614612439E-0001 < 5.77215664901533E-0001 < 5.77215715195277E-0001
28 5.77215666763975E-0001 = 5.77215664901533E-0001
6.93147179628528E-0001 < 6.93147180559945E-0001 < 6.93147181491174E-0001
5.77215638826938E-0001 < 5.77215664901533E-0001 < 5.77215690981002E-0001
29 5.77215665832559E-0001 = 5.77215664901533E-0001
6.93147180094224E-0001 < 6.93147180559945E-0001 < 6.93147181025547E-0001
5.77215651398791E-0001 < 5.77215664901533E-0001 < 5.77215678407146E-0001
Han de Bruijn
.
- Follow-Ups:
- Re: Rational approximations to gamma
- From: Robert Israel
- Re: Rational approximations to gamma
- From: christian.bau
- Re: Rational approximations to gamma
- Prev by Date: Re: A quiet query from a visitor
- Next by Date: Re: math is a physical process
- Previous by thread: See this
- Next by thread: Re: Rational approximations to gamma
- Index(es):