Aurel Page on Mon, 09 Sep 2024 15:13:06 +0200


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

Re: Computing p-adic logarithm with precision two


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