Paul Underwood on Tue, 09 May 2023 01:44:01 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Factoring Carmichael Numbers
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: Factoring Carmichael Numbers
- From: Paul Underwood <paulunderwood@mindless.com>
- Date: Tue, 9 May 2023 01:42:44 +0200
- Delivery-date: Tue, 09 May 2023 01:44:02 +0200
- Sensitivity: Normal
- Ui-outboundreport: notjunk:1;M01:P0:MIRwvgEirxc=;rkkluobqVdl5F37Z2lKHBjp5t03 BTGocBKD9I/k9o7LHUZfc0rPPTsPu9Avr7QGQzSLn8G+aF5pnBSWCOBoZjHSC0kl0Pw6EdilW btHrt++Dqj1L+y6Bk+zYCOJqxE5wGhgq3XFHCga3HLP9attVSXK6KtqnPtzzaxkXw34E6VmoA jM942RB5lxaL0y/6TQocGW3Wk4C0uRBONfQIUrlgLdwCogobwCPfkKc7lwxAtvzStTybarCka FCK0Cu9FQuHroSdOcjibPwAuLooKIkl3bGtnCIlFn+XS1ks+SFBJmVXW+OxQC2sRedKbw1+VQ 7LigLOuFSbJiw73mvCYTUH1UCa3KyiHjz2lSBuXdjc/V0vRlIRiZBcXX+dQkU9m/NUNkut81P ixJ9Hh9RJEjaEyyR1z8vHp26uHLDoRSiAryp0gJHFzoZN0ubnIMfcMNnWnC7FtPtw7R9beVtD 7O3ixCwxRnpcsblbC7qNavnx63yfLp7zlCU+QeKIrG1pWbkb8hPrkMPn9yqv8mpmjQd+3hRoS j7NGJJV5sPznPQKESkS01V32Swl0mFei4ff2uPsWI2rPloBaSrzg2Y64gG28skaAHQqMu2JWH qaIeMLbJI1lP8sAO5VbiTx93o7t1hGxC7ZXhwBbhtJu4hK1VEAilNQl2yPLmIfd+FkCJ4ikSO EGhUw7U7P/ZR8j1rieOQf5doxRXCRguUB/+YtbI86ioXywlglpCDogbUcZM/u3nTVVPiiilJQ GjfzwqtbdjHkOKSS7sIg4U/iPwF4UJL+0v9vsEaR6a5F6CGnDXJUbwVuVxdB9b/4H9pUQPhc5 gpQS/ZaphG8k8qNbZ1l+P9vIWcYET4T91qdHtu9MJ7/0o=
Bill wrote:
> By curiosity, why would you need to factor such numbers ? They are almost always
> built from their factorisation.
I am factoring Carmichael numbers for fun!
> You can probably speed up your code by skipping ispseudoprime until the factor
> are fairly small (or fail to factor).
Thanks for the idea.
My latest code, which I am trying to make more parallel, is:
{CfMR(n)=e=valuation(n-1,2);nm1bye=(n-1)>>e;export(e,nm1bye);vecsort(CFMR(n));}
{CFMR(N)=my(a,i,g,V=[],v,R=[],r);while(#R==0,
a=0;while(gcd(a,N)!=1||a%N==1,a=random(10000000)+2);a=Mod(a,N)^nm1bye;
g=lift(gcd(a-1,N));if(g>1,V=concat(V,g));
i=e;while(1,i--;g=lift(gcd(a+1,N));if(g>1,V=concat(V,g));if(i<0,break,a*=a));
parforeach(V,v,ispseudoprime(v),r,if(r,R=concat(R,v),R=concat(R,CFMR(v)))));R;}
Can you see how to make it truly parallel (apart from the first exponent)?
Best
Paul