Jacques Gélinas on Sun, 08 Oct 2017 10:09:19 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: a(n+1) = log(1+a(n))


Precompute the logarithm values once for all.

v=2;V=vector(400,n,v=log(1+v));

g(n)=n*(n*V[n]-2)/log(n);

g(400)

Jacques Gélinas



De : Elim Qiu <elim.qiu@gmail.com>
Envoyé : 7 octobre 2017 23:44
À : pari-users@pari.math.u-bordeaux.fr
Objet : a(n+1) = log(1+a(n))
  

I'm study the behavior of   n(n a(n) -2) / log(n)
where a(1) > 0, a(n+1) = log(1+a(n))


Using Pari:


f(n) =
{ my(v = 2);
  for(k=1,n, v = log(1+v));
  return(n*(n*v -2) / (log(n)));
}


It turns out the program runs very slowly. The same logic in python runs 100 time faster but not have the accuracy I need.


Any ideas?


Thanks