Karim Belabas on Tue, 30 Jan 2024 17:40:30 +0100


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

Re: eval bernpol


* Karim Belabas [2024-01-30 17:00]:
> * Aurel Page [2024-01-30 13:04]:
> > Dear Ruud,
> > 
> > You can directly compute the evaluated Bernoulli polynomial:
> > 
> > A285068(n) = denominator(3^n * bernpol(n,1/3));
> > 
> > You can also revert the polynomial instead of evaluating at a rational:
> > 
> > A285068b(n) = denominator(subst(Polrev(Vec(bernpol(n))),'x,3));
> 
> Slightly simpler:
> 
>   A285068c(n) = denominator(subst(polrecip(bernpol(n)), 'x, 3));

And slightly more efficient

   A285068d(n) =
   { my(B = bernpol(n), D = denominator(B, 1));
     denominator(subst(polrecip(B * D), 'x, 3) / D);
   }

(N.B. Clausen-von Staudt theorem [eventually] gives an exact formula for D,
cf A144845.)

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/