Re: Computing p-adic logarithm with precision two

Aurel Page <[email protected]> Mon, 9 Sep 2024 14:43:48 +0200
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
Dear Georgi,

On 09/09/2024 14:27, Georgi Guninski wrote:
> Is the following conjectured algorithm for computing p-adic log
> with precision two the same as pari's?
>
> {
> plog(p,B)=
> /*p-adic logarithm with precision 2*/
> local(a);
> a=lift(Mod(B,p^2)^(p-1)-1)/p;\\Fermat quotient
> if(a==0,return(0));
> return(p*(p-a));
> }

By "precision 2", do you mean computing the result up to O(p^2) or 
O(p^3)? I assume that B is assumed to be in Z_p?
If the former, then p*(p-a) is unnecessary, -a*p is sufficient. If the 
latter, then you are missing one term.

You can perform the comparison as follows:

? plog(7,2)
% = 35
? log(2+O(7^2))
% = 5*7 + O(7^2)
? log(2+O(7^3))
% = 5*7 + 5*7^2 + O(7^3)

Cheers,
Aurel